"""Fixtures for tests."""

__author__ = "Mandar Patil (mandarons@pm.me)"

import json
import os

from icloudpy import base
from requests import Response

from tests.data import photos_data

FIRST_NAME = "Quentin"
LAST_NAME = "TARANTINO"
FULL_NAME = FIRST_NAME + " " + LAST_NAME
PERSON_ID = (FIRST_NAME + LAST_NAME).lower()
PRIMARY_EMAIL = PERSON_ID + "@hotmail.fr"
APPLE_ID_EMAIL = PERSON_ID + "@me.com"
ICLOUD_ID_EMAIL = PERSON_ID + "@icloud.com"

MEMBER_1_FIRST_NAME = "John"
MEMBER_1_LAST_NAME = "TRAVOLTA"
MEMBER_1_FULL_NAME = MEMBER_1_FIRST_NAME + " " + MEMBER_1_LAST_NAME
MEMBER_1_PERSON_ID = (MEMBER_1_FIRST_NAME + MEMBER_1_LAST_NAME).lower()
MEMBER_1_APPLE_ID = MEMBER_1_PERSON_ID + "@icloud.com"

MEMBER_2_FIRST_NAME = "Uma"
MEMBER_2_LAST_NAME = "THURMAN"
MEMBER_2_FULL_NAME = MEMBER_2_FIRST_NAME + " " + MEMBER_2_LAST_NAME
MEMBER_2_PERSON_ID = (MEMBER_2_FIRST_NAME + MEMBER_2_LAST_NAME).lower()
MEMBER_2_APPLE_ID = MEMBER_2_PERSON_ID + "@outlook.fr"

FAMILY_ID = "family_" + PERSON_ID
UUID = "ABCDEFGH-1234-5678-1234-ABCDEFGHIJKL"
LOCATION_LATITUDE = 45.123456789012345
LOCATION_LONGITUDE = 6.1234567890123456

PERSON_ID = (FIRST_NAME + LAST_NAME).lower()
NOTIFICATION_ID = "12345678-1234-1234-1234-123456789012" + PERSON_ID
A_DS_ID = "123456-12-12345678-1234-1234-1234-123456789012" + PERSON_ID
WIDGET_KEY = "widget_key" + PERSON_ID

AUTHENTICATED_USER = PRIMARY_EMAIL
REQUIRES_2FA_TOKEN = "requires_2fa_token"
REQUIRES_2FA_USER = "requires_2fa_user"
VALID_USERS = [AUTHENTICATED_USER, REQUIRES_2FA_USER, APPLE_ID_EMAIL, ICLOUD_ID_EMAIL]
VALID_PASSWORD = "valid_password"
VALID_COOKIE = "valid_cookie"
VALID_TOKEN = "valid_token"
VALID_2FA_CODE = "000000"
VALID_TOKENS = [VALID_TOKEN, REQUIRES_2FA_TOKEN]

CLIENT_ID = "client_id"

# Data
AUTH_OK = {"authType": "hsa2"}

SRP_INIT_OK = {
    "iteration": 20433,
    "salt": "0samK84bcBmkVsswOpZbZg==",
    "protocol": "s2k",
    "b": "STVHcWTN9YOYn4IgtIJ6UPdPbvzvL+zza/l+6yUHUtdEyxwzpB78y8wqZ8QWSbVqjBcpl32iEA4T3nYp0LWZ5hD3r3yIJFloXvX0kpBJkr\
        +Nh8EfHuW1V50A8riH6VWyuJ8m3JmOO7/xkNgP7je8GMpt/5f/7qE3AOj73e3JR0fzQ7IopdU0tlyVX0tD7T6wCyHS52GJWDdq1I2bgzurIK2\
        /ZjR/Hwzd/67oFQPtKQgjrSRaKo5MJEfDP7C9wOlXsZqbb7igX6PeZRWrfl+iQFaA/FVeWSngB07ja3wOryY9GsYO06ELGOaQ+MpsT7mouqrGT\
        fOJ0OMh9EgrkJEM6w==",
    "c": "e-1be-8746c235-b41c-11ef-bd17-c780acb4fe15:PRN",
}
ZONES_LIST_WORKING = {
    "zones": [
        {
            "zoneID": {
                "zoneName": "PrimarySync",
                "ownerRecordName": "_fvhhqlzef1uvsgxnrw119mylkpjut1a0",
                "zoneType": "REGULAR_CUSTOM_ZONE",
            },
            "syncToken": "HwoECJGaGRgAIhYI/ZL516KyxaXfARDm2sbu7KeQiZABKAA=",
            "atomic": True,
            "isEligibleForZoneShare": True,
            "isEligibleForHierarchicalShare": True,
            "ttl": 0,
            "disableZoneDuringTtl": True,
        },
        {
            "zoneID": {
                "zoneName": "SharedSync-9DD9B767-9F30-4D6F-B658-F17DBA16D107",
                "ownerRecordName": "_fvhhqlzef1uvsgxnrw119mylkpjut1a0",
                "zoneType": "REGULAR_CUSTOM_ZONE",
            },
            "syncToken": "HwoECLiXBRgAIhUIs5Xxntqrrr9UEOLj2/q+geCjpAEoAA==",
            "atomic": True,
            "isEligibleForZoneShare": True,
            "isEligibleForHierarchicalShare": False,
        },
    ],
}

LOGIN_WORKING = {
    "dsInfo": {
        "lastName": LAST_NAME,
        "iCDPEnabled": False,
        "tantorMigrated": True,
        "dsid": PERSON_ID,
        "hsaEnabled": True,
        "ironcadeMigrated": True,
        "locale": "fr-fr_FR",
        "brZoneConsolidated": False,
        "isManagedAppleID": False,
        "gilligan-invited": "true",
        "appleIdAliases": [APPLE_ID_EMAIL, ICLOUD_ID_EMAIL],
        "hsaVersion": 2,
        "isPaidDeveloper": False,
        "countryCode": "FRA",
        "notificationId": NOTIFICATION_ID,
        "primaryEmailVerified": True,
        "aDsID": A_DS_ID,
        "locked": False,
        "hasICloudQualifyingDevice": True,
        "primaryEmail": PRIMARY_EMAIL,
        "appleIdEntries": [
            {"isPrimary": True, "type": "EMAIL", "value": PRIMARY_EMAIL},
            {"type": "EMAIL", "value": APPLE_ID_EMAIL},
            {"type": "EMAIL", "value": ICLOUD_ID_EMAIL},
        ],
        "gilligan-enabled": "true",
        "fullName": FULL_NAME,
        "languageCode": "fr-fr",
        "appleId": PRIMARY_EMAIL,
        "firstName": FIRST_NAME,
        "iCloudAppleIdAlias": ICLOUD_ID_EMAIL,
        "notesMigrated": True,
        "hasPaymentInfo": False,
        "pcsDeleted": False,
        "appleIdAlias": APPLE_ID_EMAIL,
        "brMigrated": True,
        "statusCode": 2,
        "familyEligible": True,
    },
    "hasMinimumDeviceForPhotosWeb": True,
    "iCDPEnabled": False,
    "webservices": {
        "reminders": {
            "url": "https://p31-remindersws.icloud.com:443",
            "status": "active",
        },
        "notes": {"url": "https://p38-notesws.icloud.com:443", "status": "active"},
        "mail": {"url": "https://p38-mailws.icloud.com:443", "status": "active"},
        "ckdatabasews": {
            "pcsRequired": True,
            "url": "https://p31-ckdatabasews.icloud.com:443",
            "status": "active",
        },
        "photosupload": {
            "pcsRequired": True,
            "url": "https://p31-uploadphotosws.icloud.com:443",
            "status": "active",
        },
        "photos": {
            "pcsRequired": True,
            "uploadUrl": "https://p31-uploadphotosws.icloud.com:443",
            "url": "https://p31-photosws.icloud.com:443",
            "status": "active",
        },
        "drivews": {
            "pcsRequired": True,
            "url": "https://p31-drivews.icloud.com:443",
            "status": "active",
        },
        "uploadimagews": {
            "url": "https://p31-uploadimagews.icloud.com:443",
            "status": "active",
        },
        "schoolwork": {},
        "cksharews": {"url": "https://p31-ckshare.icloud.com:443", "status": "active"},
        "findme": {"url": "https://p31-fmipweb.icloud.com:443", "status": "active"},
        "ckdeviceservice": {"url": "https://p31-ckdevice.icloud.com:443"},
        "iworkthumbnailws": {
            "url": "https://p31-iworkthumbnailws.icloud.com:443",
            "status": "active",
        },
        "calendar": {
            "url": "https://p31-calendarws.icloud.com:443",
            "status": "active",
        },
        "docws": {
            "pcsRequired": True,
            "url": "https://p31-docws.icloud.com:443",
            "status": "active",
        },
        "settings": {
            "url": "https://p31-settingsws.icloud.com:443",
            "status": "active",
        },
        "ubiquity": {
            "url": "https://p31-ubiquityws.icloud.com:443",
            "status": "active",
        },
        "streams": {"url": "https://p31-streams.icloud.com:443", "status": "active"},
        "keyvalue": {
            "url": "https://p31-keyvalueservice.icloud.com:443",
            "status": "active",
        },
        "archivews": {
            "url": "https://p31-archivews.icloud.com:443",
            "status": "active",
        },
        "push": {"url": "https://p31-pushws.icloud.com:443", "status": "active"},
        "iwmb": {"url": "https://p31-iwmb.icloud.com:443", "status": "active"},
        "iworkexportws": {
            "url": "https://p31-iworkexportws.icloud.com:443",
            "status": "active",
        },
        "geows": {"url": "https://p31-geows.icloud.com:443", "status": "active"},
        "account": {
            "iCloudEnv": {"shortId": "p", "vipSuffix": "prod"},
            "url": "https://p31-setup.icloud.com:443",
            "status": "active",
        },
        "fmf": {"url": "https://p31-fmfweb.icloud.com:443", "status": "active"},
        "contacts": {
            "url": "https://p31-contactsws.icloud.com:443",
            "status": "active",
        },
    },
    "pcsEnabled": True,
    "configBag": {
        "urls": {
            "accountCreateUI": "https://appleid.apple.com/widget/account/?widgetKey=" + WIDGET_KEY + "#!create",
            "accountLoginUI": "https://idmsa.apple.com/appleauth/auth/signin?widgetKey=" + WIDGET_KEY,
            "accountLogin": "https://setup.icloud.com/setup/ws/1/accountLogin",
            "accountRepairUI": "https://appleid.apple.com/widget/account/?widgetKey=" + WIDGET_KEY + "#!repair",
            "downloadICloudTerms": "https://setup.icloud.com/setup/ws/1/downloadLiteTerms",
            "repairDone": "https://setup.icloud.com/setup/ws/1/repairDone",
            "accountAuthorizeUI": "https://idmsa.apple.com/appleauth/auth/authorize/signin?client_id=" + WIDGET_KEY,
            "vettingUrlForEmail": "https://id.apple.com/IDMSEmailVetting/vetShareEmail",
            "accountCreate": "https://setup.icloud.com/setup/ws/1/createLiteAccount",
            "getICloudTerms": "https://setup.icloud.com/setup/ws/1/getTerms",
            "vettingUrlForPhone": "https://id.apple.com/IDMSEmailVetting/vetSharePhone",
        },
        "accountCreateEnabled": "true",
    },
    "hsaTrustedBrowser": True,
    "appsOrder": [
        "mail",
        "contacts",
        "calendar",
        "photos",
        "iclouddrive",
        "notes3",
        "reminders",
        "pages",
        "numbers",
        "keynote",
        "newspublisher",
        "fmf",
        "find",
        "settings",
    ],
    "version": 2,
    "isExtendedLogin": True,
    "pcsServiceIdentitiesIncluded": True,
    "hsaChallengeRequired": False,
    "requestInfo": {"country": "FR", "timeZone": "GMT+1", "region": "IDF"},
    "pcsDeleted": False,
    "iCloudInfo": {"SafariBookmarksHasMigratedToCloudKit": True},
    "apps": {
        "calendar": {},
        "reminders": {},
        "keynote": {"isQualifiedForBeta": True},
        "settings": {"canLaunchWithOneFactor": True},
        "mail": {},
        "numbers": {"isQualifiedForBeta": True},
        "photos": {},
        "pages": {"isQualifiedForBeta": True},
        "notes3": {},
        "find": {"canLaunchWithOneFactor": True},
        "iclouddrive": {},
        "newspublisher": {"isHidden": True},
        "fmf": {},
        "contacts": {},
    },
}

# Setup data
LOGIN_2FA = {
    "dsInfo": {
        "lastName": LAST_NAME,
        "iCDPEnabled": False,
        "tantorMigrated": True,
        "dsid": PERSON_ID,
        "hsaEnabled": True,
        "ironcadeMigrated": True,
        "locale": "fr-fr_FR",
        "brZoneConsolidated": False,
        "isManagedAppleID": False,
        "gilligan-invited": "true",
        "appleIdAliases": [APPLE_ID_EMAIL, ICLOUD_ID_EMAIL],
        "hsaVersion": 2,
        "isPaidDeveloper": False,
        "countryCode": "FRA",
        "notificationId": NOTIFICATION_ID,
        "primaryEmailVerified": True,
        "aDsID": A_DS_ID,
        "locked": False,
        "hasICloudQualifyingDevice": True,
        "primaryEmail": PRIMARY_EMAIL,
        "appleIdEntries": [
            {"isPrimary": True, "type": "EMAIL", "value": PRIMARY_EMAIL},
            {"type": "EMAIL", "value": APPLE_ID_EMAIL},
            {"type": "EMAIL", "value": ICLOUD_ID_EMAIL},
        ],
        "gilligan-enabled": "true",
        "fullName": FULL_NAME,
        "languageCode": "fr-fr",
        "appleId": PRIMARY_EMAIL,
        "firstName": FIRST_NAME,
        "iCloudAppleIdAlias": ICLOUD_ID_EMAIL,
        "notesMigrated": True,
        "hasPaymentInfo": True,
        "pcsDeleted": False,
        "appleIdAlias": APPLE_ID_EMAIL,
        "brMigrated": True,
        "statusCode": 2,
        "familyEligible": True,
    },
    "hasMinimumDeviceForPhotosWeb": True,
    "iCDPEnabled": False,
    "webservices": {
        "reminders": {
            "url": "https://p31-remindersws.icloud.com:443",
            "status": "active",
        },
        "notes": {"url": "https://p38-notesws.icloud.com:443", "status": "active"},
        "mail": {"url": "https://p38-mailws.icloud.com:443", "status": "active"},
        "ckdatabasews": {
            "pcsRequired": True,
            "url": "https://p31-ckdatabasews.icloud.com:443",
            "status": "active",
        },
        "photosupload": {
            "pcsRequired": True,
            "url": "https://p31-uploadphotosws.icloud.com:443",
            "status": "active",
        },
        "photos": {
            "pcsRequired": True,
            "uploadUrl": "https://p31-uploadphotosws.icloud.com:443",
            "url": "https://p31-photosws.icloud.com:443",
            "status": "active",
        },
        "drivews": {
            "pcsRequired": True,
            "url": "https://p31-drivews.icloud.com:443",
            "status": "active",
        },
        "uploadimagews": {
            "url": "https://p31-uploadimagews.icloud.com:443",
            "status": "active",
        },
        "schoolwork": {},
        "cksharews": {"url": "https://p31-ckshare.icloud.com:443", "status": "active"},
        "findme": {"url": "https://p31-fmipweb.icloud.com:443", "status": "active"},
        "ckdeviceservice": {"url": "https://p31-ckdevice.icloud.com:443"},
        "iworkthumbnailws": {
            "url": "https://p31-iworkthumbnailws.icloud.com:443",
            "status": "active",
        },
        "calendar": {
            "url": "https://p31-calendarws.icloud.com:443",
            "status": "active",
        },
        "docws": {
            "pcsRequired": True,
            "url": "https://p31-docws.icloud.com:443",
            "status": "active",
        },
        "settings": {
            "url": "https://p31-settingsws.icloud.com:443",
            "status": "active",
        },
        "ubiquity": {
            "url": "https://p31-ubiquityws.icloud.com:443",
            "status": "active",
        },
        "streams": {"url": "https://p31-streams.icloud.com:443", "status": "active"},
        "keyvalue": {
            "url": "https://p31-keyvalueservice.icloud.com:443",
            "status": "active",
        },
        "archivews": {
            "url": "https://p31-archivews.icloud.com:443",
            "status": "active",
        },
        "push": {"url": "https://p31-pushws.icloud.com:443", "status": "active"},
        "iwmb": {"url": "https://p31-iwmb.icloud.com:443", "status": "active"},
        "iworkexportws": {
            "url": "https://p31-iworkexportws.icloud.com:443",
            "status": "active",
        },
        "geows": {"url": "https://p31-geows.icloud.com:443", "status": "active"},
        "account": {
            "iCloudEnv": {"shortId": "p", "vipSuffix": "prod"},
            "url": "https://p31-setup.icloud.com:443",
            "status": "active",
        },
        "fmf": {"url": "https://p31-fmfweb.icloud.com:443", "status": "active"},
        "contacts": {
            "url": "https://p31-contactsws.icloud.com:443",
            "status": "active",
        },
    },
    "pcsEnabled": True,
    "configBag": {
        "urls": {
            "accountCreateUI": "https://appleid.apple.com/widget/account/?widgetKey=" + WIDGET_KEY + "#!create",
            "accountLoginUI": "https://idmsa.apple.com/appleauth/auth/signin?widgetKey=" + WIDGET_KEY,
            "accountLogin": "https://setup.icloud.com/setup/ws/1/accountLogin",
            "accountRepairUI": "https://appleid.apple.com/widget/account/?widgetKey=" + WIDGET_KEY + "#!repair",
            "downloadICloudTerms": "https://setup.icloud.com/setup/ws/1/downloadLiteTerms",
            "repairDone": "https://setup.icloud.com/setup/ws/1/repairDone",
            "accountAuthorizeUI": "https://idmsa.apple.com/appleauth/auth/authorize/signin?client_id=" + WIDGET_KEY,
            "vettingUrlForEmail": "https://id.apple.com/IDMSEmailVetting/vetShareEmail",
            "accountCreate": "https://setup.icloud.com/setup/ws/1/createLiteAccount",
            "getICloudTerms": "https://setup.icloud.com/setup/ws/1/getTerms",
            "vettingUrlForPhone": "https://id.apple.com/IDMSEmailVetting/vetSharePhone",
        },
        "accountCreateEnabled": "true",
    },
    "hsaTrustedBrowser": False,
    "appsOrder": [
        "mail",
        "contacts",
        "calendar",
        "photos",
        "iclouddrive",
        "notes3",
        "reminders",
        "pages",
        "numbers",
        "keynote",
        "newspublisher",
        "fmf",
        "find",
        "settings",
    ],
    "version": 2,
    "isExtendedLogin": True,
    "pcsServiceIdentitiesIncluded": False,
    "hsaChallengeRequired": True,
    "requestInfo": {"country": "FR", "timeZone": "GMT+1", "region": "IDF"},
    "pcsDeleted": False,
    "iCloudInfo": {"SafariBookmarksHasMigratedToCloudKit": True},
    "apps": {
        "calendar": {},
        "reminders": {},
        "keynote": {"isQualifiedForBeta": True},
        "settings": {"canLaunchWithOneFactor": True},
        "mail": {},
        "numbers": {"isQualifiedForBeta": True},
        "photos": {},
        "pages": {"isQualifiedForBeta": True},
        "notes3": {},
        "find": {"canLaunchWithOneFactor": True},
        "iclouddrive": {},
        "newspublisher": {"isHidden": True},
        "fmf": {},
        "contacts": {},
    },
}

TRUSTED_DEVICE_1 = {
    "deviceType": "SMS",
    "areaCode": "",
    "phoneNumber": "*******58",
    "deviceId": "1",
}
TRUSTED_DEVICES = {"devices": [TRUSTED_DEVICE_1]}

VERIFICATION_CODE_OK = {"success": True}
VERIFICATION_CODE_KO = {"success": False}

# Data
# Re-generated device :
# id = rawDeviceModel + prsId (if not None)
# baUUID = UUID + id
# So they can still be faked and unique
FMI_FAMILY_WORKING = {
    "userInfo": {
        "accountFormatter": 0,
        "firstName": FIRST_NAME,
        "lastName": LAST_NAME,
        "membersInfo": {
            MEMBER_1_PERSON_ID: {
                "accountFormatter": 0,
                "firstName": MEMBER_1_FIRST_NAME,
                "lastName": MEMBER_1_LAST_NAME,
                "deviceFetchStatus": "LOADING",
                "useAuthWidget": True,
                "isHSA": True,
                "appleId": MEMBER_1_APPLE_ID,
            },
            MEMBER_2_PERSON_ID: {
                "accountFormatter": 0,
                "firstName": MEMBER_2_FIRST_NAME,
                "lastName": MEMBER_2_LAST_NAME,
                "deviceFetchStatus": "LOADING",
                "useAuthWidget": True,
                "isHSA": True,
                "appleId": MEMBER_2_APPLE_ID,
            },
        },
        "hasMembers": True,
    },
    "serverContext": {
        "minCallbackIntervalInMS": 5000,
        "enable2FAFamilyActions": False,
        "preferredLanguage": "fr-fr",
        "lastSessionExtensionTime": None,
        "enableMapStats": True,
        "callbackIntervalInMS": 2000,
        "validRegion": True,
        "timezone": {
            "currentOffset": -25200000,
            "previousTransition": 1583661599999,
            "previousOffset": -28800000,
            "tzCurrentName": "Pacific Daylight Time",
            "tzName": "America/Los_Angeles",
        },
        "authToken": None,
        "maxCallbackIntervalInMS": 60000,
        "classicUser": False,
        "isHSA": True,
        "trackInfoCacheDurationInSecs": 86400,
        "imageBaseUrl": "https://statici.icloud.com",
        "minTrackLocThresholdInMts": 100,
        "maxLocatingTime": 90000,
        "sessionLifespan": 900000,
        "info": "info_id",
        "prefsUpdateTime": 1413548552466,
        "useAuthWidget": True,
        "clientId": CLIENT_ID,
        "enable2FAFamilyRemove": False,
        "serverTimestamp": 1585867038112,
        "deviceImageVersion": "4",
        "macCount": 0,
        "deviceLoadStatus": "200",
        "maxDeviceLoadTime": 60000,
        "prsId": PERSON_ID,
        "showSllNow": False,
        "cloudUser": True,
        "enable2FAErase": False,
    },
    "alert": None,
    "userPreferences": {
        "webPrefs": {
            "id": "web_prefs",
            "selectedDeviceId": "iPhone4,1",
        },
    },
    "content": [
        {
            "msg": {
                "strobe": False,
                "userText": False,
                "playSound": True,
                "vibrate": True,
                "createTimestamp": 1584520568680,
                "statusCode": "200",
            },
            "canWipeAfterLock": True,
            "baUUID": UUID + "iPhone12,1",
            "wipeInProgress": False,
            "lostModeEnabled": False,
            "activationLocked": True,
            "passcodeLength": 6,
            "deviceStatus": "200",
            "deviceColor": "1-6-0",
            "features": {
                "BTR": False,
                "LLC": False,
                "CLK": False,
                "TEU": True,
                "SND": True,
                "CLT": False,
                "SVP": False,
                "SPN": False,
                "XRM": False,
                "CWP": False,
                "MSG": True,
                "LOC": True,
                "LMG": False,
                "LKL": False,
                "LST": True,
                "LKM": False,
                "WMG": True,
                "PSS": False,
                "PIN": False,
                "LCK": True,
                "REM": False,
                "MCS": False,
                "KEY": False,
                "KPD": False,
                "WIP": True,
            },
            "lowPowerMode": True,
            "rawDeviceModel": "iPhone12,1",
            "id": "iPhone12,1",
            "remoteLock": None,
            "isLocating": True,
            "modelDisplayName": "iPhone",
            "lostTimestamp": "",
            "batteryLevel": 0.8299999833106995,
            "mesg": None,
            "locationEnabled": True,
            "lockedTimestamp": None,
            "locFoundEnabled": False,
            "snd": {"createTimestamp": 1584520568680, "statusCode": "200"},
            "fmlyShare": False,
            "lostDevice": None,
            "lostModeCapable": True,
            "wipedTimestamp": None,
            "deviceDisplayName": "iPhone 11",
            "prsId": None,
            "audioChannels": [],
            "locationCapable": True,
            "batteryStatus": "NotCharging",
            "trackingInfo": None,
            "name": "iPhone de " + FIRST_NAME,
            "isMac": False,
            "thisDevice": False,
            "deviceClass": "iPhone",
            "location": {
                "isOld": False,
                "isInaccurate": False,
                "altitude": 0.0,
                "positionType": "GPS",
                "latitude": LOCATION_LATITUDE,
                "floorLevel": 0,
                "horizontalAccuracy": 4.5370291025030465,
                "locationType": "",
                "timeStamp": 1585867037749,
                "locationFinished": True,
                "verticalAccuracy": 0.0,
                "longitude": LOCATION_LONGITUDE,
            },
            "deviceModel": "iphone11-1-6-0",
            "maxMsgChar": 160,
            "darkWake": False,
            "remoteWipe": None,
        },
        {
            "msg": {
                "strobe": False,
                "userText": True,
                "playSound": False,
                "vibrate": False,
                "createTimestamp": 1583057432463,
                "statusCode": "205",
            },
            "canWipeAfterLock": True,
            "baUUID": "",
            "wipeInProgress": False,
            "lostModeEnabled": False,
            "activationLocked": False,
            "passcodeLength": 4,
            "deviceStatus": "203",
            "deviceColor": None,
            "features": {
                "BTR": False,
                "LLC": False,
                "CLK": False,
                "TEU": True,
                "SND": True,
                "CLT": False,
                "SVP": False,
                "SPN": False,
                "XRM": False,
                "CWP": False,
                "MSG": True,
                "LOC": True,
                "LMG": False,
                "LKL": True,
                "LST": True,
                "LKM": False,
                "WMG": False,
                "PSS": False,
                "PIN": False,
                "LCK": True,
                "REM": True,
                "MCS": False,
                "KEY": False,
                "KPD": False,
                "WIP": True,
            },
            "lowPowerMode": False,
            "rawDeviceModel": "iPhone4,1",
            "id": "iPhone4,1",
            "remoteLock": None,
            "isLocating": False,
            "modelDisplayName": "iPhone",
            "lostTimestamp": "",
            "batteryLevel": 0.0,
            "mesg": {"createTimestamp": 1583057432463, "statusCode": "205"},
            "locationEnabled": True,
            "lockedTimestamp": None,
            "locFoundEnabled": False,
            "snd": None,
            "fmlyShare": False,
            "lostDevice": {
                "stopLostMode": False,
                "emailUpdates": True,
                "userText": True,
                "sound": False,
                "ownerNbr": "",
                "text": "",
                "createTimestamp": 1463594549526,
                "statusCode": "2201",
            },
            "lostModeCapable": True,
            "wipedTimestamp": None,
            "deviceDisplayName": "iPhone 4s",
            "prsId": None,
            "audioChannels": [],
            "locationCapable": True,
            "batteryStatus": "Unknown",
            "trackingInfo": None,
            "name": "iPhone " + FULL_NAME,
            "isMac": False,
            "thisDevice": False,
            "deviceClass": "iPhone",
            "location": None,
            "deviceModel": "FifthGen",
            "maxMsgChar": 160,
            "darkWake": False,
            "remoteWipe": None,
        },
        {
            "msg": {
                "strobe": False,
                "userText": True,
                "playSound": False,
                "vibrate": False,
                "createTimestamp": 1583057432463,
                "statusCode": "205",
            },
            "canWipeAfterLock": True,
            "baUUID": "",
            "wipeInProgress": False,
            "lostModeEnabled": False,
            "activationLocked": False,
            "passcodeLength": 4,
            "deviceStatus": "203",
            "deviceColor": "white",
            "features": {
                "BTR": False,
                "LLC": False,
                "CLK": False,
                "TEU": True,
                "SND": True,
                "CLT": False,
                "SVP": False,
                "SPN": False,
                "XRM": False,
                "CWP": False,
                "MSG": True,
                "LOC": True,
                "LMG": False,
                "LKL": True,
                "LST": True,
                "LKM": False,
                "WMG": False,
                "PSS": False,
                "PIN": False,
                "LCK": True,
                "REM": True,
                "MCS": False,
                "KEY": False,
                "KPD": False,
                "WIP": True,
            },
            "lowPowerMode": False,
            "rawDeviceModel": "iPod4,1",
            "id": "iPod4,1",
            "remoteLock": None,
            "isLocating": False,
            "modelDisplayName": "iPod",
            "lostTimestamp": "",
            "batteryLevel": 0.0,
            "mesg": {"createTimestamp": 1583057432463, "statusCode": "205"},
            "locationEnabled": True,
            "lockedTimestamp": None,
            "locFoundEnabled": False,
            "snd": None,
            "fmlyShare": False,
            "lostDevice": None,
            "lostModeCapable": True,
            "wipedTimestamp": None,
            "deviceDisplayName": "iPod touch (4th generation)",
            "prsId": None,
            "audioChannels": [],
            "locationCapable": True,
            "batteryStatus": "Unknown",
            "trackingInfo": None,
            "name": "iPod Touch 4 " + MEMBER_2_FIRST_NAME,
            "isMac": False,
            "thisDevice": False,
            "deviceClass": "iPod",
            "location": None,
            "deviceModel": "FourthGen-white",
            "maxMsgChar": 160,
            "darkWake": False,
            "remoteWipe": None,
        },
        {
            "msg": {
                "strobe": False,
                "userText": False,
                "playSound": True,
                "vibrate": False,
                "createTimestamp": 1398963329049,
                "statusCode": "200",
            },
            "canWipeAfterLock": False,
            "baUUID": "",
            "wipeInProgress": False,
            "lostModeEnabled": False,
            "activationLocked": False,
            "passcodeLength": 4,
            "deviceStatus": "203",
            "deviceColor": None,
            "features": {
                "BTR": False,
                "LLC": False,
                "CLK": False,
                "TEU": False,
                "SND": True,
                "CLT": False,
                "SVP": False,
                "SPN": False,
                "XRM": False,
                "CWP": False,
                "MSG": True,
                "LOC": True,
                "LMG": True,
                "LKL": True,
                "LST": False,
                "LKM": True,
                "WMG": False,
                "PSS": False,
                "PIN": True,
                "LCK": True,
                "REM": True,
                "MCS": False,
                "KEY": True,
                "KPD": True,
                "WIP": True,
            },
            "lowPowerMode": False,
            "rawDeviceModel": "MacBookPro10,1",
            "id": "MacBookPro10,1",
            "remoteLock": None,
            "isLocating": False,
            "modelDisplayName": "MacBook Pro",
            "lostTimestamp": "",
            "batteryLevel": 0.0,
            "mesg": None,
            "locationEnabled": True,
            "lockedTimestamp": None,
            "locFoundEnabled": False,
            "snd": {"createTimestamp": 1398963329049, "statusCode": "200"},
            "fmlyShare": False,
            "lostDevice": None,
            "lostModeCapable": False,
            "wipedTimestamp": None,
            "deviceDisplayName": "MacBook Pro 15'",
            "prsId": None,
            "audioChannels": [],
            "locationCapable": True,
            "batteryStatus": "Unknown",
            "trackingInfo": None,
            "name": "Retina " + MEMBER_2_FIRST_NAME,
            "isMac": True,
            "thisDevice": False,
            "deviceClass": "MacBookPro",
            "location": None,
            "deviceModel": "MacBookPro10_1",
            "maxMsgChar": 500,
            "darkWake": False,
            "remoteWipe": None,
        },
        {
            "msg": {
                "strobe": False,
                "userText": True,
                "playSound": False,
                "vibrate": False,
                "createTimestamp": 1583057432463,
                "statusCode": "200",
            },
            "canWipeAfterLock": False,
            "baUUID": "",
            "wipeInProgress": False,
            "lostModeEnabled": False,
            "activationLocked": False,
            "passcodeLength": 6,
            "deviceStatus": "203",
            "deviceColor": None,
            "features": {
                "BTR": False,
                "LLC": False,
                "CLK": False,
                "TEU": False,
                "SND": True,
                "CLT": False,
                "SVP": False,
                "SPN": False,
                "XRM": False,
                "CWP": False,
                "MSG": True,
                "LOC": True,
                "LMG": True,
                "LKL": True,
                "LST": False,
                "LKM": True,
                "WMG": False,
                "PSS": False,
                "PIN": True,
                "LCK": True,
                "REM": True,
                "MCS": False,
                "KEY": False,
                "KPD": True,
                "WIP": True,
            },
            "lowPowerMode": False,
            "rawDeviceModel": "MacBookPro11,3",
            "id": "MacBookPro11,3",
            "remoteLock": {"createTimestamp": 1433338956786, "statusCode": "2201"},
            "isLocating": False,
            "modelDisplayName": "MacBook Pro",
            "lostTimestamp": "",
            "batteryLevel": 0.0,
            "mesg": {"createTimestamp": 1583057432463, "statusCode": "200"},
            "locationEnabled": True,
            "lockedTimestamp": None,
            "locFoundEnabled": False,
            "snd": None,
            "fmlyShare": False,
            "lostDevice": None,
            "lostModeCapable": False,
            "wipedTimestamp": None,
            "deviceDisplayName": "MacBook Pro 15'",
            "prsId": None,
            "audioChannels": [],
            "locationCapable": True,
            "batteryStatus": "Unknown",
            "trackingInfo": None,
            "name": "Retina " + FIRST_NAME,
            "isMac": True,
            "thisDevice": False,
            "deviceClass": "MacBookPro",
            "location": None,
            "deviceModel": "MacBookPro11_3",
            "maxMsgChar": 500,
            "darkWake": False,
            "remoteWipe": None,
        },
        {
            "msg": {
                "strobe": False,
                "userText": True,
                "playSound": False,
                "vibrate": False,
                "createTimestamp": 1583057432463,
                "statusCode": "200",
            },
            "canWipeAfterLock": False,
            "baUUID": UUID + "MacBookPro15,1",
            "wipeInProgress": False,
            "lostModeEnabled": False,
            "activationLocked": True,
            "passcodeLength": 6,
            "deviceStatus": "201",
            "deviceColor": "spacegray",
            "features": {
                "BTR": False,
                "LLC": False,
                "CLK": False,
                "TEU": False,
                "SND": True,
                "CLT": False,
                "SVP": False,
                "SPN": False,
                "XRM": False,
                "CWP": False,
                "MSG": True,
                "LOC": True,
                "LMG": True,
                "LKL": False,
                "LST": False,
                "LKM": True,
                "WMG": False,
                "PSS": False,
                "PIN": True,
                "LCK": True,
                "REM": True,
                "MCS": False,
                "KEY": True,
                "KPD": True,
                "WIP": True,
            },
            "lowPowerMode": False,
            "rawDeviceModel": "MacBookPro15,1",
            "id": "MacBookPro15,1",
            "remoteLock": None,
            "isLocating": False,
            "modelDisplayName": "MacBook Pro",
            "lostTimestamp": "",
            "batteryLevel": 0.26968246698379517,
            "mesg": {"createTimestamp": 1583057432463, "statusCode": "200"},
            "locationEnabled": True,
            "lockedTimestamp": None,
            "locFoundEnabled": False,
            "snd": None,
            "fmlyShare": False,
            "lostDevice": None,
            "lostModeCapable": False,
            "wipedTimestamp": None,
            "deviceDisplayName": "MacBook Pro 15'",
            "prsId": None,
            "audioChannels": [],
            "locationCapable": True,
            "batteryStatus": "Charging",
            "trackingInfo": None,
            "name": "MacBook Pro de " + FIRST_NAME,
            "isMac": True,
            "thisDevice": False,
            "deviceClass": "MacBookPro",
            "location": {
                "isOld": False,
                "isInaccurate": False,
                "altitude": 0.0,
                "positionType": "Wifi",
                "latitude": LOCATION_LATITUDE,
                "floorLevel": 0,
                "horizontalAccuracy": 65.0,
                "locationType": "",
                "timeStamp": 1585867020040,
                "locationFinished": False,
                "verticalAccuracy": 0.0,
                "longitude": LOCATION_LONGITUDE,
            },
            "deviceModel": "MacBookPro15_1-spacegray",
            "maxMsgChar": 500,
            "darkWake": False,
            "remoteWipe": None,
        },
        {
            "msg": None,
            "canWipeAfterLock": False,
            "baUUID": "",
            "wipeInProgress": False,
            "lostModeEnabled": False,
            "activationLocked": False,
            "passcodeLength": 6,
            "deviceStatus": "200",
            "deviceColor": "0",
            "features": {
                "BTR": True,
                "LLC": False,
                "CLK": False,
                "TEU": False,
                "SND": True,
                "CLT": False,
                "SVP": False,
                "SPN": False,
                "XRM": False,
                "CWP": False,
                "MSG": True,
                "LOC": True,
                "LMG": False,
                "LKL": False,
                "LST": False,
                "LKM": False,
                "WMG": False,
                "PSS": True,
                "PIN": False,
                "LCK": False,
                "REM": False,
                "MCS": True,
                "KEY": False,
                "KPD": False,
                "WIP": False,
            },
            "lowPowerMode": False,
            "rawDeviceModel": "AirPods_8207",
            "id": "AirPods_8207",
            "remoteLock": None,
            "isLocating": False,
            "modelDisplayName": "Accessory",
            "lostTimestamp": "",
            "batteryLevel": 0.0,
            "mesg": None,
            "locationEnabled": True,
            "lockedTimestamp": None,
            "locFoundEnabled": False,
            "snd": None,
            "fmlyShare": False,
            "lostDevice": None,
            "lostModeCapable": False,
            "wipedTimestamp": None,
            "deviceDisplayName": "Accessory",
            "prsId": None,
            "audioChannels": [
                {"name": "left", "available": 1, "playing": False, "muted": False},
                {"name": "right", "available": 1, "playing": False, "muted": False},
            ],
            "locationCapable": True,
            "batteryStatus": "Unknown",
            "trackingInfo": None,
            "name": "AirPods de " + FULL_NAME,
            "isMac": False,
            "thisDevice": False,
            "deviceClass": "Accessory",
            "location": {
                "isOld": False,
                "isInaccurate": False,
                "altitude": 0.0,
                "positionType": "GPS",
                "latitude": LOCATION_LATITUDE,
                "floorLevel": 0,
                "horizontalAccuracy": 4.5370291025030465,
                "locationType": "",
                "timeStamp": 1585867037749,
                "locationFinished": True,
                "verticalAccuracy": 0.0,
                "longitude": LOCATION_LONGITUDE,
            },
            "deviceModel": "AirPods_8207-0",
            "maxMsgChar": 160,
            "darkWake": False,
            "remoteWipe": None,
        },
        {
            "msg": None,
            "canWipeAfterLock": False,
            "baUUID": "",
            "wipeInProgress": False,
            "lostModeEnabled": False,
            "activationLocked": False,
            "passcodeLength": 4,
            "deviceStatus": "201",
            "deviceColor": None,
            "features": {
                "BTR": False,
                "LLC": False,
                "CLK": False,
                "TEU": False,
                "SND": True,
                "CLT": False,
                "SVP": False,
                "SPN": False,
                "XRM": False,
                "CWP": False,
                "MSG": True,
                "LOC": True,
                "LMG": True,
                "LKL": False,
                "LST": False,
                "LKM": True,
                "WMG": False,
                "PSS": False,
                "PIN": True,
                "LCK": True,
                "REM": True,
                "MCS": False,
                "KEY": True,
                "KPD": True,
                "WIP": True,
            },
            "lowPowerMode": False,
            "rawDeviceModel": "MacBookPro10,1",
            "id": "MacBookPro10,1" + MEMBER_2_PERSON_ID,
            "remoteLock": None,
            "isLocating": False,
            "modelDisplayName": "MacBook Pro",
            "lostTimestamp": "",
            "batteryLevel": 0.0,
            "mesg": None,
            "locationEnabled": True,
            "lockedTimestamp": None,
            "locFoundEnabled": False,
            "snd": None,
            "fmlyShare": False,
            "lostDevice": None,
            "lostModeCapable": False,
            "wipedTimestamp": None,
            "deviceDisplayName": "MacBook Pro 15'",
            "prsId": MEMBER_2_PERSON_ID,
            "audioChannels": [],
            "locationCapable": True,
            "batteryStatus": "Unknown",
            "trackingInfo": None,
            "name": "MacBook Pro de " + MEMBER_2_FIRST_NAME,
            "isMac": True,
            "thisDevice": False,
            "deviceClass": "MacBookPro",
            "location": None,
            "deviceModel": "MacBookPro10_1",
            "maxMsgChar": 500,
            "darkWake": False,
            "remoteWipe": None,
        },
        {
            "msg": None,
            "canWipeAfterLock": True,
            "baUUID": UUID + "iPhone12,1" + MEMBER_2_PERSON_ID,
            "wipeInProgress": False,
            "lostModeEnabled": False,
            "activationLocked": True,
            "passcodeLength": 6,
            "deviceStatus": "200",
            "deviceColor": "1-7-0",
            "features": {
                "BTR": False,
                "LLC": False,
                "CLK": False,
                "TEU": True,
                "SND": True,
                "CLT": False,
                "SVP": False,
                "SPN": False,
                "XRM": False,
                "CWP": False,
                "MSG": True,
                "LOC": True,
                "LMG": False,
                "LKL": False,
                "LST": True,
                "LKM": False,
                "WMG": True,
                "PSS": False,
                "PIN": False,
                "LCK": True,
                "REM": True,
                "MCS": False,
                "KEY": False,
                "KPD": False,
                "WIP": True,
            },
            "lowPowerMode": False,
            "rawDeviceModel": "iPhone12,1",
            "id": "iPhone12,1" + MEMBER_2_PERSON_ID,
            "remoteLock": None,
            "isLocating": False,
            "modelDisplayName": "iPhone",
            "lostTimestamp": "",
            "batteryLevel": 0.3400000035762787,
            "mesg": None,
            "locationEnabled": True,
            "lockedTimestamp": None,
            "locFoundEnabled": True,
            "snd": None,
            "fmlyShare": False,
            "lostDevice": None,
            "lostModeCapable": True,
            "wipedTimestamp": None,
            "deviceDisplayName": "iPhone 11",
            "prsId": MEMBER_2_PERSON_ID,
            "audioChannels": [],
            "locationCapable": True,
            "batteryStatus": "NotCharging",
            "trackingInfo": None,
            "name": "iPhone " + MEMBER_2_FIRST_NAME,
            "isMac": False,
            "thisDevice": False,
            "deviceClass": "iPhone",
            "location": None,
            "deviceModel": "iphone11-1-7-0",
            "maxMsgChar": 160,
            "darkWake": False,
            "remoteWipe": None,
        },
        {
            "msg": {
                "strobe": False,
                "userText": True,
                "playSound": False,
                "vibrate": False,
                "createTimestamp": 1583057432335,
                "statusCode": "200",
            },
            "canWipeAfterLock": False,
            "baUUID": "",
            "wipeInProgress": False,
            "lostModeEnabled": False,
            "activationLocked": False,
            "passcodeLength": 6,
            "deviceStatus": "203",
            "deviceColor": None,
            "features": {
                "BTR": False,
                "LLC": False,
                "CLK": False,
                "TEU": False,
                "SND": True,
                "CLT": False,
                "SVP": False,
                "SPN": False,
                "XRM": False,
                "CWP": False,
                "MSG": True,
                "LOC": True,
                "LMG": True,
                "LKL": True,
                "LST": False,
                "LKM": True,
                "WMG": False,
                "PSS": False,
                "PIN": True,
                "LCK": True,
                "REM": True,
                "MCS": False,
                "KEY": True,
                "KPD": True,
                "WIP": True,
            },
            "lowPowerMode": False,
            "rawDeviceModel": "iMac10,1",
            "id": "iMac10,1" + MEMBER_1_PERSON_ID,
            "remoteLock": None,
            "isLocating": False,
            "modelDisplayName": "iMac",
            "lostTimestamp": "",
            "batteryLevel": 0.0,
            "mesg": {"createTimestamp": 1583057432335, "statusCode": "200"},
            "locationEnabled": True,
            "lockedTimestamp": None,
            "locFoundEnabled": False,
            "snd": None,
            "fmlyShare": True,
            "lostDevice": None,
            "lostModeCapable": False,
            "wipedTimestamp": None,
            "deviceDisplayName": "iMac",
            "prsId": MEMBER_1_PERSON_ID,
            "audioChannels": [],
            "locationCapable": True,
            "batteryStatus": "Unknown",
            "trackingInfo": None,
            "name": "iMac 27' " + MEMBER_1_LAST_NAME,
            "isMac": True,
            "thisDevice": False,
            "deviceClass": "iMac",
            "location": None,
            "deviceModel": "iMac10_1",
            "maxMsgChar": 500,
            "darkWake": False,
            "remoteWipe": None,
        },
        {
            "msg": None,
            "canWipeAfterLock": True,
            "baUUID": UUID + "iPad7,3" + MEMBER_1_PERSON_ID,
            "wipeInProgress": False,
            "lostModeEnabled": False,
            "activationLocked": True,
            "passcodeLength": 6,
            "deviceStatus": "201",
            "deviceColor": "2-2-0",
            "features": {
                "BTR": False,
                "LLC": False,
                "CLK": False,
                "TEU": True,
                "SND": True,
                "CLT": False,
                "SVP": False,
                "SPN": False,
                "XRM": False,
                "CWP": False,
                "MSG": True,
                "LOC": True,
                "LMG": False,
                "LKL": True,
                "LST": True,
                "LKM": False,
                "WMG": True,
                "PSS": False,
                "PIN": False,
                "LCK": True,
                "REM": True,
                "MCS": False,
                "KEY": False,
                "KPD": False,
                "WIP": True,
            },
            "lowPowerMode": False,
            "rawDeviceModel": "iPad7,3",
            "id": "iPad7,3" + MEMBER_1_PERSON_ID,
            "remoteLock": None,
            "isLocating": False,
            "modelDisplayName": "iPad",
            "lostTimestamp": "",
            "batteryLevel": 0.3799999952316284,
            "mesg": None,
            "locationEnabled": True,
            "lockedTimestamp": None,
            "locFoundEnabled": False,
            "snd": None,
            "fmlyShare": True,
            "lostDevice": None,
            "lostModeCapable": True,
            "wipedTimestamp": None,
            "deviceDisplayName": "iPad Pro",
            "prsId": MEMBER_1_PERSON_ID,
            "audioChannels": [],
            "locationCapable": True,
            "batteryStatus": "NotCharging",
            "trackingInfo": None,
            "name": "iPad " + MEMBER_1_LAST_NAME,
            "isMac": False,
            "thisDevice": False,
            "deviceClass": "iPad",
            "location": None,
            "deviceModel": "NinthGen-2-2-0",
            "maxMsgChar": 160,
            "darkWake": False,
            "remoteWipe": None,
        },
        {
            "msg": {
                "strobe": False,
                "userText": True,
                "playSound": False,
                "vibrate": False,
                "createTimestamp": 1583057432335,
                "statusCode": "205",
            },
            "canWipeAfterLock": True,
            "baUUID": "",
            "wipeInProgress": False,
            "lostModeEnabled": False,
            "activationLocked": False,
            "passcodeLength": 4,
            "deviceStatus": "203",
            "deviceColor": None,
            "features": {
                "BTR": False,
                "LLC": False,
                "CLK": False,
                "TEU": True,
                "SND": True,
                "CLT": False,
                "SVP": False,
                "SPN": False,
                "XRM": False,
                "CWP": False,
                "MSG": True,
                "LOC": True,
                "LMG": False,
                "LKL": True,
                "LST": True,
                "LKM": False,
                "WMG": False,
                "PSS": False,
                "PIN": False,
                "LCK": True,
                "REM": True,
                "MCS": False,
                "KEY": False,
                "KPD": False,
                "WIP": True,
            },
            "lowPowerMode": False,
            "rawDeviceModel": "iPhone4,1",
            "id": "iPhone4,1" + MEMBER_1_PERSON_ID,
            "remoteLock": None,
            "isLocating": False,
            "modelDisplayName": "iPhone",
            "lostTimestamp": "",
            "batteryLevel": 0.0,
            "mesg": {"createTimestamp": 1583057432335, "statusCode": "205"},
            "locationEnabled": True,
            "lockedTimestamp": None,
            "locFoundEnabled": False,
            "snd": None,
            "fmlyShare": True,
            "lostDevice": None,
            "lostModeCapable": True,
            "wipedTimestamp": None,
            "deviceDisplayName": "iPhone 4s",
            "prsId": MEMBER_1_PERSON_ID,
            "audioChannels": [],
            "locationCapable": True,
            "batteryStatus": "Unknown",
            "trackingInfo": None,
            "name": "iPhone",
            "isMac": False,
            "thisDevice": False,
            "deviceClass": "iPhone",
            "location": None,
            "deviceModel": "FifthGen",
            "maxMsgChar": 160,
            "darkWake": False,
            "remoteWipe": None,
        },
        {
            "msg": {
                "strobe": False,
                "userText": True,
                "playSound": False,
                "vibrate": False,
                "createTimestamp": 1583057432335,
                "statusCode": "200",
            },
            "canWipeAfterLock": True,
            "baUUID": "",
            "wipeInProgress": False,
            "lostModeEnabled": False,
            "activationLocked": True,
            "passcodeLength": 6,
            "deviceStatus": "201",
            "deviceColor": "e1e4e3-d7d9d8",
            "features": {
                "BTR": False,
                "LLC": False,
                "CLK": False,
                "TEU": True,
                "SND": True,
                "CLT": False,
                "SVP": False,
                "SPN": False,
                "XRM": False,
                "CWP": False,
                "MSG": True,
                "LOC": True,
                "LMG": False,
                "LKL": False,
                "LST": True,
                "LKM": False,
                "WMG": True,
                "PSS": False,
                "PIN": False,
                "LCK": True,
                "REM": True,
                "MCS": False,
                "KEY": False,
                "KPD": False,
                "WIP": True,
            },
            "lowPowerMode": True,
            "rawDeviceModel": "iPhone6,2",
            "id": "iPhone6,2" + MEMBER_1_PERSON_ID,
            "remoteLock": None,
            "isLocating": True,
            "modelDisplayName": "iPhone",
            "lostTimestamp": "",
            "batteryLevel": 0.800000011920929,
            "mesg": {"createTimestamp": 1583057432335, "statusCode": "200"},
            "locationEnabled": True,
            "lockedTimestamp": None,
            "locFoundEnabled": False,
            "snd": None,
            "fmlyShare": True,
            "lostDevice": None,
            "lostModeCapable": True,
            "wipedTimestamp": None,
            "deviceDisplayName": "iPhone 5s",
            "prsId": MEMBER_1_PERSON_ID,
            "audioChannels": [],
            "locationCapable": True,
            "batteryStatus": "NotCharging",
            "trackingInfo": None,
            "name": "iPhone de " + MEMBER_1_FIRST_NAME,
            "isMac": False,
            "thisDevice": False,
            "deviceClass": "iPhone",
            "location": {
                "isOld": False,
                "isInaccurate": False,
                "altitude": 0.0,
                "positionType": "GPS",
                "latitude": LOCATION_LATITUDE,
                "floorLevel": 0,
                "horizontalAccuracy": 50.0,
                "locationType": "",
                "timeStamp": 1585866941186,
                "locationFinished": False,
                "verticalAccuracy": 0.0,
                "longitude": LOCATION_LONGITUDE,
            },
            "deviceModel": "5s-e1e4e3-d7d9d8",
            "maxMsgChar": 160,
            "darkWake": False,
            "remoteWipe": None,
        },
    ],
    "statusCode": "200",
}

# Data
DRIVE_ROOT_WORKING = [
    {
        "drivewsid": "FOLDER::com.apple.CloudDocs::root",
        "docwsid": "root",
        "zone": "com.apple.CloudDocs",
        "name": "",
        "etag": "31",
        "type": "FOLDER",
        "assetQuota": 62418076,
        "fileCount": 7,
        "shareCount": 0,
        "shareAliasCount": 0,
        "directChildrenCount": 3,
        "items": [
            {
                "dateCreated": "2019-12-12T14:33:55-08:00",
                "drivewsid": "FOLDER::com.apple.Keynote::documents",
                "docwsid": "documents",
                "zone": "com.apple.Keynote",
                "name": "Keynote",
                "parentId": "FOLDER::com.apple.CloudDocs::root",
                "etag": "2m",
                "type": "APP_LIBRARY",
                "maxDepth": "ANY",
                "items": [],
                "icons": [
                    {
                        "url": "https://p31-drivews.icloud.com/getIcons?id=com.apple.Keynote&field=icon120x120_iOS",
                        "type": "IOS",
                        "size": 120,
                    },
                    {
                        "url": "https://p31-drivews.icloud.com/getIcons?id=com.apple.Keynote&field=icon80x80_iOS",
                        "type": "IOS",
                        "size": 80,
                    },
                    {
                        "url": "https://p31-drivews.icloud.com/getIcons?id=com.apple.Keynote&field=icon40x40_iOS",
                        "type": "IOS",
                        "size": 40,
                    },
                ],
                "supportedExtensions": [
                    "pptx",
                    "ppsx",
                    "pps",
                    "pot",
                    "key-tef",
                    "ppt",
                    "potx",
                    "potm",
                    "pptm",
                    "ppsm",
                    "key",
                    "kth",
                ],
                "supportedTypes": [
                    "com.microsoft.powerpoint.pps",
                    "com.microsoft.powerpoint.pot",
                    "com.microsoft.powerpoint.ppt",
                    "org.openxmlformats.presentationml.template.macroenabled",
                    "org.openxmlformats.presentationml.slideshow.macroenabled",
                    "com.apple.iwork.keynote.key-tef",
                    "org.openxmlformats.presentationml.template",
                    "org.openxmlformats.presentationml.presentation.macroenabled",
                    "com.apple.iwork.keynote.key",
                    "com.apple.iwork.keynote.kth",
                    "org.openxmlformats.presentationml.presentation",
                    "org.openxmlformats.presentationml.slideshow",
                    "com.apple.iwork.keynote.sffkey",
                    "com.apple.iwork.keynote.sffkth",
                ],
            },
            {
                "dateCreated": "2019-12-12T14:33:55-08:00",
                "drivewsid": "FOLDER::com.apple.Numbers::documents",
                "docwsid": "documents",
                "zone": "com.apple.Numbers",
                "name": "Numbers",
                "parentId": "FOLDER::com.apple.CloudDocs::root",
                "etag": "3k",
                "type": "APP_LIBRARY",
                "maxDepth": "ANY",
                "items": [],
                "icons": [
                    {
                        "url": "https://p31-drivews.icloud.com/getIcons?id=com.apple.Numbers&field=icon120x120_iOS",
                        "type": "IOS",
                        "size": 120,
                    },
                    {
                        "url": "https://p31-drivews.icloud.com/getIcons?id=com.apple.Numbers&field=icon80x80_iOS",
                        "type": "IOS",
                        "size": 80,
                    },
                    {
                        "url": "https://p31-drivews.icloud.com/getIcons?id=com.apple.Numbers&field=icon40x40_iOS",
                        "type": "IOS",
                        "size": 40,
                    },
                ],
                "supportedExtensions": [
                    "hh",
                    "ksh",
                    "lm",
                    "xlt",
                    "c++",
                    "f95",
                    "lid",
                    "csv",
                    "numbers",
                    "php4",
                    "hp",
                    "py",
                    "nmbtemplate",
                    "lmm",
                    "jscript",
                    "php3",
                    "crash",
                    "patch",
                    "java",
                    "ym",
                    "xlam",
                    "text",
                    "mi",
                    "exp",
                    "adb",
                    "jav",
                    "ada",
                    "ii",
                    "defs",
                    "mm",
                    "cpp",
                    "cxx",
                    "pas",
                    "diff",
                    "pch++",
                    "javascript",
                    "panic",
                    "rb",
                    "ads",
                    "tcsh",
                    "ypp",
                    "yxx",
                    "ph3",
                    "ph4",
                    "phtml",
                    "xltx",
                    "hang",
                    "rbw",
                    "f77",
                    "for",
                    "js",
                    "h++",
                    "mig",
                    "gpurestart",
                    "mii",
                    "zsh",
                    "m3u",
                    "pch",
                    "sh",
                    "xltm",
                    "applescript",
                    "tsv",
                    "ymm",
                    "shutdownstall",
                    "cc",
                    "xlsx",
                    "scpt",
                    "c",
                    "inl",
                    "f",
                    "numbers-tef",
                    "h",
                    "i",
                    "hpp",
                    "hxx",
                    "dlyan",
                    "xla",
                    "l",
                    "cp",
                    "m",
                    "lpp",
                    "lxx",
                    "txt",
                    "r",
                    "s",
                    "xlsm",
                    "spin",
                    "php",
                    "csh",
                    "y",
                    "bash",
                    "m3u8",
                    "pl",
                    "f90",
                    "pm",
                    "xls",
                ],
                "supportedTypes": [
                    "org.openxmlformats.spreadsheetml.sheet",
                    "com.microsoft.excel.xla",
                    "com.apple.iwork.numbers.template",
                    "org.openxmlformats.spreadsheetml.sheet.macroenabled",
                    "com.apple.iwork.numbers.sffnumbers",
                    "com.apple.iwork.numbers.numbers",
                    "public.plain-text",
                    "com.microsoft.excel.xlt",
                    "org.openxmlformats.spreadsheetml.template",
                    "com.microsoft.excel.xls",
                    "public.comma-separated-values-text",
                    "com.apple.iwork.numbers.numbers-tef",
                    "org.openxmlformats.spreadsheetml.template.macroenabled",
                    "public.tab-separated-values-text",
                    "com.apple.iwork.numbers.sfftemplate",
                    "com.microsoft.excel.openxml.addin",
                ],
            },
            {
                "dateCreated": "2019-12-12T14:33:55-08:00",
                "drivewsid": "FOLDER::com.apple.Pages::documents",
                "docwsid": "documents",
                "zone": "com.apple.Pages",
                "name": "Pages",
                "parentId": "FOLDER::com.apple.CloudDocs::root",
                "etag": "km",
                "type": "APP_LIBRARY",
                "maxDepth": "ANY",
                "items": [],
                "icons": [
                    {
                        "url": "https://p31-drivews.icloud.com/getIcons?id=com.apple.Pages&field=icon120x120_iOS",
                        "type": "IOS",
                        "size": 120,
                    },
                    {
                        "url": "https://p31-drivews.icloud.com/getIcons?id=com.apple.Pages&field=icon80x80_iOS",
                        "type": "IOS",
                        "size": 80,
                    },
                    {
                        "url": "https://p31-drivews.icloud.com/getIcons?id=com.apple.Pages&field=icon40x40_iOS",
                        "type": "IOS",
                        "size": 40,
                    },
                ],
                "supportedExtensions": [
                    "hh",
                    "ksh",
                    "lm",
                    "c++",
                    "f95",
                    "lid",
                    "php4",
                    "hp",
                    "py",
                    "lmm",
                    "jscript",
                    "php3",
                    "crash",
                    "patch",
                    "pages",
                    "java",
                    "ym",
                    "text",
                    "mi",
                    "exp",
                    "adb",
                    "jav",
                    "ada",
                    "ii",
                    "defs",
                    "mm",
                    "cpp",
                    "cxx",
                    "pas",
                    "pages-tef",
                    "diff",
                    "pch++",
                    "javascript",
                    "panic",
                    "rb",
                    "ads",
                    "tcsh",
                    "rtfd",
                    "ypp",
                    "yxx",
                    "doc",
                    "ph3",
                    "ph4",
                    "template",
                    "phtml",
                    "hang",
                    "rbw",
                    "f77",
                    "dot",
                    "for",
                    "js",
                    "h++",
                    "mig",
                    "gpurestart",
                    "mii",
                    "zsh",
                    "m3u",
                    "pch",
                    "sh",
                    "applescript",
                    "ymm",
                    "shutdownstall",
                    "dotx",
                    "cc",
                    "scpt",
                    "c",
                    "rtf",
                    "inl",
                    "f",
                    "h",
                    "i",
                    "hpp",
                    "hxx",
                    "dlyan",
                    "l",
                    "cp",
                    "m",
                    "lpp",
                    "lxx",
                    "docx",
                    "txt",
                    "r",
                    "s",
                    "spin",
                    "php",
                    "csh",
                    "y",
                    "bash",
                    "m3u8",
                    "pl",
                    "f90",
                    "pm",
                ],
                "supportedTypes": [
                    "com.apple.rtfd",
                    "com.apple.iwork.pages.sffpages",
                    "com.apple.iwork.pages.sfftemplate",
                    "com.microsoft.word.dot",
                    "com.apple.iwork.pages.pages",
                    "com.microsoft.word.doc",
                    "org.openxmlformats.wordprocessingml.template",
                    "org.openxmlformats.wordprocessingml.document",
                    "com.apple.iwork.pages.pages-tef",
                    "com.apple.iwork.pages.template",
                    "public.rtf",
                    "public.plain-text",
                ],
            },
            {
                "dateCreated": "2019-12-12T14:33:55-08:00",
                "drivewsid": "FOLDER::com.apple.Preview::documents",
                "docwsid": "documents",
                "zone": "com.apple.Preview",
                "name": "Preview",
                "parentId": "FOLDER::com.apple.CloudDocs::root",
                "etag": "bv",
                "type": "APP_LIBRARY",
                "maxDepth": "ANY",
                "items": [],
                "icons": [
                    {
                        "url": "https://p31-drivews.icloud.com/getIcons?id=com.apple.Preview&field=icon32x32_OSX",
                        "type": "OSX",
                        "size": 32,
                    },
                    {
                        "url": "https://p31-drivews.icloud.com/getIcons?id=com.apple.Preview&field=icon128x128_OSX",
                        "type": "OSX",
                        "size": 128,
                    },
                    {
                        "url": "https://p31-drivews.icloud.com/getIcons?id=com.apple.Preview&field=icon16x16_OSX",
                        "type": "OSX",
                        "size": 16,
                    },
                    {
                        "url": "https://p31-drivews.icloud.com/getIcons?id=com.apple.Preview&field=icon256x256_OSX",
                        "type": "OSX",
                        "size": 256,
                    },
                    {
                        "url": "https://p31-drivews.icloud.com/getIcons?id=com.apple.Preview&field=icon64x64_OSX",
                        "type": "OSX",
                        "size": 64,
                    },
                ],
                "supportedExtensions": [
                    "ps",
                    "nmbtemplate",
                    "astc",
                    "mpkg",
                    "prefpane",
                    "pef",
                    "mos",
                    "qlgenerator",
                    "scptd",
                    "raf",
                    "saver",
                    "band",
                    "dng",
                    "pict",
                    "exr",
                    "kth",
                    "appex",
                    "app",
                    "pages-tef",
                    "slidesaver",
                    "pluginkit",
                    "distz",
                    "ai",
                    "png",
                    "eps",
                    "raw",
                    "pvr",
                    "mpo",
                    "ktx",
                    "nrw",
                    "lpdf",
                    "pfm",
                    "3fr",
                    "template",
                    "imovielibrary",
                    "pwl",
                    "iwwebpackage",
                    "wdgt",
                    "tga",
                    "pgm",
                    "erf",
                    "jpeg",
                    "j2c",
                    "bundle",
                    "key",
                    "j2k",
                    "abc",
                    "arw",
                    "xpc",
                    "pic",
                    "ppm",
                    "menu",
                    "icns",
                    "mrw",
                    "plugin",
                    "mdimporter",
                    "bmp",
                    "numbers",
                    "dae",
                    "dist",
                    "pic",
                    "rw2",
                    "nef",
                    "tif",
                    "pages",
                    "sgi",
                    "ico",
                    "theater",
                    "gbproj",
                    "webplugin",
                    "cr2",
                    "fff",
                    "webp",
                    "jp2",
                    "sr2",
                    "rtfd",
                    "pbm",
                    "pkpass",
                    "jfx",
                    "fpbf",
                    "psd",
                    "xbm",
                    "tiff",
                    "avchd",
                    "gif",
                    "pntg",
                    "rwl",
                    "pset",
                    "pkg",
                    "dcr",
                    "hdr",
                    "jpe",
                    "pct",
                    "jpg",
                    "jpf",
                    "orf",
                    "srf",
                    "numbers-tef",
                    "iconset",
                    "crw",
                    "fpx",
                    "dds",
                    "pdf",
                    "jpx",
                    "key-tef",
                    "efx",
                    "hdr",
                    "srw",
                ],
                "supportedTypes": [
                    "com.adobe.illustrator.ai-image",
                    "com.kodak.flashpix-image",
                    "public.pbm",
                    "com.apple.pict",
                    "com.ilm.openexr-image",
                    "com.sgi.sgi-image",
                    "com.apple.icns",
                    "public.heifs",
                    "com.truevision.tga-image",
                    "com.adobe.postscript",
                    "public.camera-raw-image",
                    "public.pvr",
                    "public.png",
                    "com.adobe.photoshop-image",
                    "public.heif",
                    "com.microsoft.ico",
                    "com.adobe.pdf",
                    "public.heic",
                    "public.xbitmap-image",
                    "com.apple.localized-pdf-bundle",
                    "public.3d-content",
                    "com.compuserve.gif",
                    "public.avci",
                    "public.jpeg",
                    "com.apple.rjpeg",
                    "com.adobe.encapsulated-postscript",
                    "com.microsoft.bmp",
                    "public.fax",
                    "org.khronos.astc",
                    "com.apple.application-bundle",
                    "public.avcs",
                    "public.webp",
                    "public.heics",
                    "com.apple.macpaint-image",
                    "public.mpo-image",
                    "public.jpeg-2000",
                    "public.tiff",
                    "com.microsoft.dds",
                    "com.apple.pdf-printer-settings",
                    "org.khronos.ktx",
                    "public.radiance",
                    "com.apple.package",
                    "public.folder",
                ],
            },
            {
                "drivewsid": "FOLDER::com.apple.CloudDocs::1C7F1760-D940-480F-8C4F-005824A4E05B",
                "docwsid": "1C7F1760-D940-480F-8C4F-005824A4E05B",
                "zone": "com.apple.CloudDocs",
                "name": "icloudpy",
                "parentId": "FOLDER::com.apple.CloudDocs::root",
                "etag": "30",
                "type": "FOLDER",
                "assetQuota": 42199575,
                "fileCount": 2,
                "shareCount": 0,
                "shareAliasCount": 0,
                "directChildrenCount": 1,
            },
            {
                "drivewsid": "FOLDER::com.apple.CloudDocs::1C7F1760-D940-480F-8C4F-005824A4E05C",
                "docwsid": "1C7F1760-D940-480F-8C4F-005824A4E05C",
                "zone": "com.apple.CloudDocs",
                "name": "unwanted",
                "parentId": "FOLDER::com.apple.CloudDocs::root",
                "etag": "30",
                "type": "FOLDER",
                "assetQuota": 42199575,
                "fileCount": 0,
                "shareCount": 0,
                "shareAliasCount": 0,
                "directChildrenCount": 0,
            },
            {
                "drivewsid": "FOLDER::com.apple.CloudDocs::1C7F1760-D940-480F-8C4F-005824A4E05D",
                "docwsid": "1C7F1760-D940-480F-8C4F-005824A4E05D",
                "zone": "com.apple.CloudDocs",
                "name": "Obsidian",
                "parentId": "FOLDER::com.apple.CloudDocs::root",
                "etag": "30",
                "type": "APP_LIBRARY",
                "maxDepth": "ANY",
                "icons": [
                    {
                        "url": "https://p104-drivews.icloud.com/getIcons?id=iCloud.md.obsidian&field=icon120x120_iOS",
                        "type": "IOS",
                        "size": 120,
                    },
                    {
                        "url": "https://p104-drivews.icloud.com/getIcons?id=iCloud.md.obsidian&field=icon80x80_iOS",
                        "type": "IOS",
                        "size": 80,
                    },
                    {
                        "url": "https://p104-drivews.icloud.com/getIcons?id=iCloud.md.obsidian&field=icon40x40_iOS",
                        "type": "IOS",
                        "size": 40,
                    },
                ],
                "supportedExtensions": [
                    "sd2",
                    "ksh",
                    "xlt",
                    "xlw",
                    "m75",
                    "der",
                    "xml",
                    "raf",
                    "emlx",
                    "shtml",
                    "kth",
                    "pict",
                    "3g2",
                    "ram",
                    "itms",
                    "aa",
                    "imoviemobile",
                    "cdg",
                    "ai",
                    "raw",
                    "diff",
                    "ktx",
                    "panic",
                    "sda",
                    "sdd",
                    "as",
                    "sdc",
                    "au",
                    "ypp",
                    "sdp",
                    "sf2",
                    "3fr",
                    "xltx",
                    "hang",
                    "aac",
                    "aae",
                    "sdv",
                    "rbw",
                    "sdw",
                    "aaf",
                    "wma",
                    "jss",
                    "cel",
                    "pptm",
                    "zsh",
                    "sea",
                    "savedsearch",
                    "tga",
                    "ac3",
                    "ppsx",
                    "cer",
                    "xltm",
                    "epub",
                    "bz",
                    "jpeg",
                    "aax",
                    "j2c",
                    "wmp",
                    "flc",
                    "3gp",
                    "tgios-theme",
                    "dotx",
                    "cc",
                    "xlsx",
                    "scpt",
                    "wmv",
                    "minc",
                    "j2k",
                    "fli",
                    "abc",
                    "wmx",
                    "c",
                    "f",
                    "tgz",
                    "h",
                    "i",
                    "hpp",
                    "dylib",
                    "bdm",
                    "dotm",
                    "l",
                    "cp",
                    "m",
                    "lxx",
                    "ppsm",
                    "icns",
                    "o",
                    "flv",
                    "r",
                    "s",
                    "xlsm",
                    "spin",
                    "y",
                    "z",
                    "xlsb",
                    "dif",
                    "potm",
                    "hqx",
                    "jscript",
                    "tif",
                    "dv",
                    "sgi",
                    "adb",
                    "ada",
                    "pas",
                    "pax",
                    "pptx",
                    "cdda",
                    "ads",
                    "pbm",
                    "ulw",
                    "blank",
                    "eml",
                    "pntg",
                    "smil",
                    "for",
                    "pch",
                    "applescript",
                    "json",
                    "class",
                    "sit",
                    "htm",
                    "pct",
                    "dll",
                    "mobile",
                    "dls",
                    "unf",
                    "fpx",
                    "pdf",
                    "gz",
                    "key-tef",
                    "potx",
                    "hh",
                    "c++",
                    "bin",
                    "hp",
                    "clipspkg",
                    "pef",
                    "pem",
                    "text",
                    "dng",
                    "ii",
                    "defs",
                    "afploc",
                    "eps",
                    "pfa",
                    "odb",
                    "pfb",
                    "odc",
                    "odf",
                    "tcsh",
                    "odg",
                    "clipsother",
                    "lpdf",
                    "odi",
                    "slm",
                    "pfm",
                    "yxx",
                    "odm",
                    "doc",
                    "odp",
                    "ph3",
                    "ulaw",
                    "ph4",
                    "odt",
                    "ods",
                    "aif",
                    "template",
                    "pfx",
                    "bdmv",
                    "dot",
                    "js",
                    "smf",
                    "fileloc",
                    "smi",
                    "xhtm",
                    "sml",
                    "pgm",
                    "erf",
                    "shutdownstall",
                    "sidx",
                    "pcmplite3",
                    "snd",
                    "hxx",
                    "dlyan",
                    "gzip",
                    "pic",
                    "mobileconfig",
                    "url",
                    "wvx",
                    "php",
                    "lm",
                    "bmp",
                    "newsloc",
                    "php4",
                    "pic",
                    "nef",
                    "mpga",
                    "php3",
                    "f4a",
                    "download",
                    "pages",
                    "etd",
                    "f4b",
                    "mi",
                    "mm",
                    "cpp",
                    "cr2",
                    "f4p",
                    "mpg4",
                    "f4v",
                    "qtpxcomposition",
                    "sr2",
                    "mpeg",
                    "pkpass",
                    "imovieother",
                    "tiff",
                    "inetloc",
                    "pset",
                    "f77",
                    "amr",
                    "gpurestart",
                    "pkg",
                    "adts",
                    "tbz2",
                    "tsv",
                    "kar",
                    "ttc",
                    "crt",
                    "srf",
                    "ttf",
                    "crw",
                    "gtar",
                    "srt",
                    "pf",
                    "pls",
                    "jnlp",
                    "csh",
                    "srw",
                    "pl",
                    "f90",
                    "pm",
                    "ssa",
                    "ps",
                    "f95",
                    "textclipping",
                    "mobileprovision",
                    "csv",
                    "py",
                    "mpkg",
                    "astc",
                    "cpgz",
                    "nii",
                    "crash",
                    "patch",
                    "rmvb",
                    "exe",
                    "java",
                    "xlam",
                    "docm",
                    "jar",
                    "band",
                    "exp",
                    "jav",
                    "exr",
                    "app",
                    "std",
                    "qt",
                    "stc",
                    "png",
                    "sti",
                    "vcard",
                    "javascript",
                    "ra",
                    "rb",
                    "stw",
                    "rm",
                    "ftploc",
                    "phtml",
                    "sub",
                    "rt",
                    "omf",
                    "mid",
                    "mig",
                    "mii",
                    "webarchive",
                    "rss",
                    "pot",
                    "sh",
                    "imovietrailer",
                    "key",
                    "rtf",
                    "svg",
                    "arw",
                    "ppm",
                    "docx",
                    "txt",
                    "pps",
                    "inss",
                    "asf",
                    "ppt",
                    "m3u8",
                    "cpio",
                    "ts",
                    "ass",
                    "lid",
                    "asx",
                    "numbers",
                    "icc",
                    "rw2",
                    "p12",
                    "icm",
                    "ico",
                    "ul",
                    "ics",
                    "sxd",
                    "sxc",
                    "uu",
                    "svgz",
                    "cxx",
                    "sxg",
                    "sxi",
                    "qti",
                    "xar",
                    "sxm",
                    "pch++",
                    "bwf",
                    "sxw",
                    "qtif",
                    "rtfd",
                    "qtz",
                    "idx",
                    "jfx",
                    "psb",
                    "psd",
                    "xbm",
                    "aiff",
                    "rwl",
                    "aifc",
                    "wave",
                    "avi",
                    "wm",
                    "hdr",
                    "bz2",
                    "emlxpart",
                    "orf",
                    "mnc",
                    "numbers-tef",
                    "war",
                    "wav",
                    "mp2",
                    "xhtml",
                    "wax",
                    "mp4",
                    "mp3",
                    "hdr",
                    "bash",
                    "provisionprofile",
                    "dfont",
                    "nmbtemplate",
                    "aupreset",
                    "lmm",
                    "mos",
                    "midi",
                    "ym",
                    "mov",
                    "otc",
                    "zip",
                    "otf",
                    "oth",
                    "otg",
                    "mpe",
                    "pages-tef",
                    "oti",
                    "mpg",
                    "otp",
                    "pvr",
                    "mpo",
                    "ott",
                    "ots",
                    "nrw",
                    "xfd",
                    "suit",
                    "pictclipping",
                    "pwl",
                    "3gp2",
                    "m15",
                    "plist",
                    "configprofile",
                    "vcf",
                    "vcs",
                    "fdf",
                    "pcmplite",
                    "lpp",
                    "sitx",
                    "mrw",
                    "xht",
                    "dae",
                    "3gpp",
                    "gbproj",
                    "html",
                    "xip",
                    "webloc",
                    "tar",
                    "fff",
                    "jp2",
                    "edn",
                    "mailloc",
                    "vcal",
                    "m2v",
                    "shtm",
                    "icloud",
                    "gif",
                    "vfw",
                    "xfdf",
                    "h++",
                    "caf",
                    "tbz",
                    "m3u",
                    "dcm",
                    "dcr",
                    "ymm",
                    "m4b",
                    "m4a",
                    "jpe",
                    "jpg",
                    "jpf",
                    "inl",
                    "m4p",
                    "m4r",
                    "xla",
                    "m4v",
                    "dds",
                    "jpx",
                    "efx",
                    "xls",
                ],
                "supportedTypes": [
                    "net.daringfireball.markdown",
                    "public.data",
                    "public.content",
                ],
                "items": [
                    {
                        "dateCreated": "2021-08-01T17:22:00Z",
                        "drivewsid": "FOLDER::com.apple.CloudDocs::117F1760-D940-480F-8C4F-005824A4E05D",
                        "docwsid": "117F1760-D940-480F-8C4F-005824A4E05D",
                        "zone": "com.apple.CloudDocs",
                        "name": "Sample",
                        "parentId": "FOLDER::com.apple.CloudDocs::appDocuments_iCloud.md.obsidian",
                        "etag": "4iop",
                        "type": "FOLDER",
                        "assetQuota": 2191,
                        "fileCount": 1,
                        "shareCount": 0,
                        "shareAliasCount": 0,
                        "directChildrenCount": 1,
                        "items": [
                            {
                                "dateCreated": "2021-08-01T17:21:54Z",
                                "drivewsid": "FILE::com.apple.CloudDocs::111F1760-D940-480F-8C4F-005824A4E05D",
                                "docwsid": "111F1760-D940-480F-8C4F-005824A4E05D",
                                "zone": "com.apple.CloudDocs",
                                "name": "This is a title",
                                "extension": "md",
                                "parentId": "FOLDER::com.apple.CloudDocs::117F1760-D940-480F-8C4F-005824A4E05D",
                                "dateModified": "2021-08-01T17:21:54Z",
                                "dateChanged": "2021-12-02T23:44:55Z",
                                "size": 14,
                                "etag": "4ioq::4eu3",
                                "type": "FILE",
                            },
                            {
                                "dateCreated": "2021-08-01T19:21:54Z",
                                "drivewsid": "FILE::com.apple.CloudDocs::111F1760-D940-480F-8C4F-005824A4E05E",
                                "docwsid": "111F1760-D940-480F-8C4F-005824A4E05E",
                                "zone": "com.apple.CloudDocs",
                                "name": "Project",
                                "extension": "band",
                                "parentId": "FOLDER::com.apple.CloudDocs::117F1760-D940-480F-8C4F-005824A4E05D",
                                "dateModified": "2021-08-01T19:21:54Z",
                                "dateChanged": "2021-12-02T23:44:55Z",
                                "size": 588272,
                                "etag": "4ioq::4eu4",
                                "type": "FILE",
                            },
                            {
                                "dateCreated": "2021-08-02T19:21:54Z",
                                "drivewsid": "FILE::com.apple.CloudDocs::111F1760-D940-480F-8C4F-005824A4E05F",
                                "docwsid": "111F1760-D940-480F-8C4F-005824A4E05F",
                                "zone": "com.apple.CloudDocs",
                                "name": "ms",
                                "extension": "band",
                                "parentId": "FOLDER::com.apple.CloudDocs::117F1760-D940-480F-8C4F-005824A4E05D",
                                "dateModified": "2021-08-01T19:21:54Z",
                                "dateChanged": "2021-12-02T23:44:55Z",
                                "size": 225621,
                                "etag": "4ioq::4eu4",
                                "type": "FILE",
                            },
                            {
                                "dateCreated": "2021-08-02T19:21:54Z",
                                "drivewsid": "FILE::com.apple.CloudDocs::111F1760-D940-480F-8C4F-005824A4E05G",
                                "docwsid": "111F1760-D940-480F-8C4F-005824A4E05G",
                                "zone": "com.apple.CloudDocs",
                                "name": "Fotoksiążka-Wzór",
                                "extension": "xmcf",
                                "parentId": "FOLDER::com.apple.CloudDocs::117F1760-D940-480F-8C4F-005824A4E05D",
                                "dateModified": "2021-08-01T19:21:54Z",
                                "dateChanged": "2021-12-02T23:44:55Z",
                                "size": 31514,
                                "etag": "4ioq::4eu4",
                                "type": "FILE",
                            },
                        ],
                    },
                ],
                "numberOfItems": 1,
                "status": "OK",
            },
        ],
        "numberOfItems": 5,
    },
]

# App specific folder (Keynote, Numbers, Pages, Preview ...) type=APP_LIBRARY
DRIVE_ROOT_INVALID = [{"drivewsid": "FOLDER::com.apple.CloudDocs::documents", "status": "ID_INVALID"}]

DRIVE_FOLDER_WORKING = [
    {
        "drivewsid": "FOLDER::com.apple.CloudDocs::1C7F1760-D940-480F-8C4F-005824A4E05B",
        "docwsid": "1C7F1760-D940-480F-8C4F-005824A4E05B",
        "zone": "com.apple.CloudDocs",
        "name": "icloudpy",
        "parentId": "FOLDER::com.apple.CloudDocs::root",
        "etag": "30",
        "type": "FOLDER",
        "assetQuota": 42199575,
        "fileCount": 2,
        "shareCount": 0,
        "shareAliasCount": 0,
        "directChildrenCount": 1,
        "items": [
            {
                "drivewsid": "FOLDER::com.apple.CloudDocs::D5AA0425-E84F-4501-AF5D-60F1D92648CF",
                "docwsid": "D5AA0425-E84F-4501-AF5D-60F1D92648CF",
                "zone": "com.apple.CloudDocs",
                "name": "Test",
                "parentId": "FOLDER::com.apple.CloudDocs::1C7F1760-D940-480F-8C4F-005824A4E05B",
                "etag": "2z",
                "type": "FOLDER",
                "assetQuota": 42199575,
                "fileCount": 2,
                "shareCount": 0,
                "shareAliasCount": 0,
                "directChildrenCount": 2,
            },
        ],
        "numberOfItems": 1,
    },
    {
        "drivewsid": "FOLDER::com.apple.CloudDocs::1C7F1760-D940-480F-8C4F-005824A4E05C",
        "docwsid": "1C7F1760-D940-480F-8C4F-005824A4E05C",
        "zone": "com.apple.CloudDocs",
        "name": "unwanted",
        "parentId": "FOLDER::com.apple.CloudDocs::root",
        "etag": "30",
        "type": "FOLDER",
        "assetQuota": 42199575,
        "fileCount": 0,
        "shareCount": 0,
        "shareAliasCount": 0,
        "directChildrenCount": 0,
        "items": [],
        "numberOfItems": 0,
    },
    {
        "drivewsid": "FOLDER::com.apple.CloudDocs::1C7F1760-D940-480F-8C4F-005824A4E05D",
        "docwsid": "1C7F1760-D940-480F-8C4F-005824A4E05D",
        "zone": "com.apple.CloudDocs",
        "name": "Obsidian",
        "parentId": "FOLDER::com.apple.CloudDocs::root",
        "etag": "30",
        "type": "APP_LIBRARY",
        "maxDepth": "ANY",
        "icons": [
            {
                "url": "https://p104-drivews.icloud.com/getIcons?id=iCloud.md.obsidian&field=icon120x120_iOS",
                "type": "IOS",
                "size": 120,
            },
            {
                "url": "https://p104-drivews.icloud.com/getIcons?id=iCloud.md.obsidian&field=icon80x80_iOS",
                "type": "IOS",
                "size": 80,
            },
            {
                "url": "https://p104-drivews.icloud.com/getIcons?id=iCloud.md.obsidian&field=icon40x40_iOS",
                "type": "IOS",
                "size": 40,
            },
        ],
        "supportedExtensions": [
            "sd2",
            "ksh",
            "xlt",
            "xlw",
            "m75",
            "der",
            "xml",
            "raf",
            "emlx",
            "shtml",
            "kth",
            "pict",
            "3g2",
            "ram",
            "itms",
            "aa",
            "imoviemobile",
            "cdg",
            "ai",
            "raw",
            "diff",
            "ktx",
            "panic",
            "sda",
            "sdd",
            "as",
            "sdc",
            "au",
            "ypp",
            "sdp",
            "sf2",
            "3fr",
            "xltx",
            "hang",
            "aac",
            "aae",
            "sdv",
            "rbw",
            "sdw",
            "aaf",
            "wma",
            "jss",
            "cel",
            "pptm",
            "zsh",
            "sea",
            "savedsearch",
            "tga",
            "ac3",
            "ppsx",
            "cer",
            "xltm",
            "epub",
            "bz",
            "jpeg",
            "aax",
            "j2c",
            "wmp",
            "flc",
            "3gp",
            "tgios-theme",
            "dotx",
            "cc",
            "xlsx",
            "scpt",
            "wmv",
            "minc",
            "j2k",
            "fli",
            "abc",
            "wmx",
            "c",
            "f",
            "tgz",
            "h",
            "i",
            "hpp",
            "dylib",
            "bdm",
            "dotm",
            "l",
            "cp",
            "m",
            "lxx",
            "ppsm",
            "icns",
            "o",
            "flv",
            "r",
            "s",
            "xlsm",
            "spin",
            "y",
            "z",
            "xlsb",
            "dif",
            "potm",
            "hqx",
            "jscript",
            "tif",
            "dv",
            "sgi",
            "adb",
            "ada",
            "pas",
            "pax",
            "pptx",
            "cdda",
            "ads",
            "pbm",
            "ulw",
            "blank",
            "eml",
            "pntg",
            "smil",
            "for",
            "pch",
            "applescript",
            "json",
            "class",
            "sit",
            "htm",
            "pct",
            "dll",
            "mobile",
            "dls",
            "unf",
            "fpx",
            "pdf",
            "gz",
            "key-tef",
            "potx",
            "hh",
            "c++",
            "bin",
            "hp",
            "clipspkg",
            "pef",
            "pem",
            "text",
            "dng",
            "ii",
            "defs",
            "afploc",
            "eps",
            "pfa",
            "odb",
            "pfb",
            "odc",
            "odf",
            "tcsh",
            "odg",
            "clipsother",
            "lpdf",
            "odi",
            "slm",
            "pfm",
            "yxx",
            "odm",
            "doc",
            "odp",
            "ph3",
            "ulaw",
            "ph4",
            "odt",
            "ods",
            "aif",
            "template",
            "pfx",
            "bdmv",
            "dot",
            "js",
            "smf",
            "fileloc",
            "smi",
            "xhtm",
            "sml",
            "pgm",
            "erf",
            "shutdownstall",
            "sidx",
            "pcmplite3",
            "snd",
            "hxx",
            "dlyan",
            "gzip",
            "pic",
            "mobileconfig",
            "url",
            "wvx",
            "php",
            "lm",
            "bmp",
            "newsloc",
            "php4",
            "pic",
            "nef",
            "mpga",
            "php3",
            "f4a",
            "download",
            "pages",
            "etd",
            "f4b",
            "mi",
            "mm",
            "cpp",
            "cr2",
            "f4p",
            "mpg4",
            "f4v",
            "qtpxcomposition",
            "sr2",
            "mpeg",
            "pkpass",
            "imovieother",
            "tiff",
            "inetloc",
            "pset",
            "f77",
            "amr",
            "gpurestart",
            "pkg",
            "adts",
            "tbz2",
            "tsv",
            "kar",
            "ttc",
            "crt",
            "srf",
            "ttf",
            "crw",
            "gtar",
            "srt",
            "pf",
            "pls",
            "jnlp",
            "csh",
            "srw",
            "pl",
            "f90",
            "pm",
            "ssa",
            "ps",
            "f95",
            "textclipping",
            "mobileprovision",
            "csv",
            "py",
            "mpkg",
            "astc",
            "cpgz",
            "nii",
            "crash",
            "patch",
            "rmvb",
            "exe",
            "java",
            "xlam",
            "docm",
            "jar",
            "band",
            "exp",
            "jav",
            "exr",
            "app",
            "std",
            "qt",
            "stc",
            "png",
            "sti",
            "vcard",
            "javascript",
            "ra",
            "rb",
            "stw",
            "rm",
            "ftploc",
            "phtml",
            "sub",
            "rt",
            "omf",
            "mid",
            "mig",
            "mii",
            "webarchive",
            "rss",
            "pot",
            "sh",
            "imovietrailer",
            "key",
            "rtf",
            "svg",
            "arw",
            "ppm",
            "docx",
            "txt",
            "pps",
            "inss",
            "asf",
            "ppt",
            "m3u8",
            "cpio",
            "ts",
            "ass",
            "lid",
            "asx",
            "numbers",
            "icc",
            "rw2",
            "p12",
            "icm",
            "ico",
            "ul",
            "ics",
            "sxd",
            "sxc",
            "uu",
            "svgz",
            "cxx",
            "sxg",
            "sxi",
            "qti",
            "xar",
            "sxm",
            "pch++",
            "bwf",
            "sxw",
            "qtif",
            "rtfd",
            "qtz",
            "idx",
            "jfx",
            "psb",
            "psd",
            "xbm",
            "aiff",
            "rwl",
            "aifc",
            "wave",
            "avi",
            "wm",
            "hdr",
            "bz2",
            "emlxpart",
            "orf",
            "mnc",
            "numbers-tef",
            "war",
            "wav",
            "mp2",
            "xhtml",
            "wax",
            "mp4",
            "mp3",
            "hdr",
            "bash",
            "provisionprofile",
            "dfont",
            "nmbtemplate",
            "aupreset",
            "lmm",
            "mos",
            "midi",
            "ym",
            "mov",
            "otc",
            "zip",
            "otf",
            "oth",
            "otg",
            "mpe",
            "pages-tef",
            "oti",
            "mpg",
            "otp",
            "pvr",
            "mpo",
            "ott",
            "ots",
            "nrw",
            "xfd",
            "suit",
            "pictclipping",
            "pwl",
            "3gp2",
            "m15",
            "plist",
            "configprofile",
            "vcf",
            "vcs",
            "fdf",
            "pcmplite",
            "lpp",
            "sitx",
            "mrw",
            "xht",
            "dae",
            "3gpp",
            "gbproj",
            "html",
            "xip",
            "webloc",
            "tar",
            "fff",
            "jp2",
            "edn",
            "mailloc",
            "vcal",
            "m2v",
            "shtm",
            "icloud",
            "gif",
            "vfw",
            "xfdf",
            "h++",
            "caf",
            "tbz",
            "m3u",
            "dcm",
            "dcr",
            "ymm",
            "m4b",
            "m4a",
            "jpe",
            "jpg",
            "jpf",
            "inl",
            "m4p",
            "m4r",
            "xla",
            "m4v",
            "dds",
            "jpx",
            "efx",
            "xls",
        ],
        "supportedTypes": [
            "net.daringfireball.markdown",
            "public.data",
            "public.content",
        ],
        "items": [
            {
                "dateCreated": "2021-08-01T17:22:00Z",
                "drivewsid": "FOLDER::com.apple.CloudDocs::117F1760-D940-480F-8C4F-005824A4E05D",
                "docwsid": "117F1760-D940-480F-8C4F-005824A4E05D",
                "zone": "com.apple.CloudDocs",
                "name": "Sample",
                "parentId": "FOLDER::com.apple.CloudDocs::appDocuments_iCloud.md.obsidian",
                "etag": "4iop",
                "type": "FOLDER",
                "assetQuota": 2191,
                "fileCount": 1,
                "shareCount": 0,
                "shareAliasCount": 0,
                "directChildrenCount": 1,
                "items": [
                    {
                        "dateCreated": "2021-08-01T17:21:54Z",
                        "drivewsid": "FILE::com.apple.CloudDocs::111F1760-D940-480F-8C4F-005824A4E05D",
                        "docwsid": "111F1760-D940-480F-8C4F-005824A4E05D",
                        "zone": "com.apple.CloudDocs",
                        "name": "This is a title",
                        "extension": "md",
                        "parentId": "FOLDER::com.apple.CloudDocs::117F1760-D940-480F-8C4F-005824A4E05D",
                        "dateModified": "2021-08-01T17:21:54Z",
                        "dateChanged": "2021-12-02T23:44:55Z",
                        "size": 14,
                        "etag": "4ioq::4eu3",
                        "type": "FILE",
                    },
                ],
            },
        ],
        "numberOfItems": 1,
        "status": "OK",
    },
]

DRIVE_SUBFOLDER_WORKING = [
    {
        "drivewsid": "FOLDER::com.apple.CloudDocs::D5AA0425-E84F-4501-AF5D-60F1D92648CF",
        "docwsid": "D5AA0425-E84F-4501-AF5D-60F1D92648CF",
        "zone": "com.apple.CloudDocs",
        "name": "Test",
        "parentId": "FOLDER::com.apple.CloudDocs::1C7F1760-D940-480F-8C4F-005824A4E05B",
        "etag": "2z",
        "type": "FOLDER",
        "assetQuota": 42199575,
        "fileCount": 2,
        "shareCount": 0,
        "shareAliasCount": 0,
        "directChildrenCount": 2,
        "items": [
            {
                "drivewsid": "FILE::com.apple.CloudDocs::33A41112-4131-4938-9691-7F356CE3C51D",
                "docwsid": "33A41112-4131-4938-9691-7F356CE3C51D",
                "zone": "com.apple.CloudDocs",
                "name": "Document scanne 2",
                "parentId": "FOLDER::com.apple.CloudDocs::D5AA0425-E84F-4501-AF5D-60F1D92648CF",
                "dateModified": "2020-04-27T21:37:36Z",
                "dateChanged": "2020-04-27T14:44:29-07:00",
                "size": os.path.getsize(
                    os.path.join(
                        os.path.dirname(__file__),
                        "ms.band",
                        "Alternatives",
                        "000",
                        "WindowImage.jpg",
                    ),
                ),
                "etag": "2k::2j",
                "extension": "pdf",
                "hiddenExtension": True,
                "lastOpenTime": "2020-04-27T21:37:36Z",
                "type": "FILE",
            },
            {
                "drivewsid": "FILE::com.apple.CloudDocs::516C896C-6AA5-4A30-B30E-5502C2333DAE",
                "docwsid": "516C896C-6AA5-4A30-B30E-5502C2333DAE",
                "zone": "com.apple.CloudDocs",
                "name": "Scanned document 1",
                "parentId": "FOLDER::com.apple.CloudDocs::D5AA0425-E84F-4501-AF5D-60F1D92648CF",
                "dateModified": "2020-05-03T00:15:17Z",
                "dateChanged": "2020-05-02T17:16:17-07:00",
                # 'size': 21644358,
                "size": os.path.getsize(
                    os.path.join(
                        os.path.dirname(__file__),
                        "ms.band",
                        "Alternatives",
                        "000",
                        "WindowImage.jpg",
                    ),
                ),
                "etag": "32::2x",
                "extension": "pdf",
                "hiddenExtension": True,
                "lastOpenTime": "2020-05-03T00:24:25Z",
                "type": "FILE",
            },
        ],
        "numberOfItems": 2,
    },
]

DRIVE_SUBFOLDER_UNWANTED_WORKING = [
    {
        "drivewsid": "FOLDER::com.apple.CloudDocs::1C7F1760-D940-480F-8C4F-005824A4E05C",
        "docwsid": "1C7F1760-D940-480F-8C4F-005824A4E05C",
        "zone": "com.apple.CloudDocs",
        "name": "unwanted",
        "parentId": "FOLDER::com.apple.CloudDocs::root",
        "etag": "30",
        "type": "FOLDER",
        "assetQuota": 42199575,
        "fileCount": 0,
        "shareCount": 0,
        "shareAliasCount": 0,
        "directChildrenCount": 0,
        "items": [],
        "numberOfItems": 0,
    },
]

DRIVE_PACKAGE_SPECIAL_CHARS_WORKING = {
    "document_id": "111F1760-D940-480F-8C4F-005824A4E05G",
    "package_token": {
        "url": "https://cvws.icloud-content.com/B/signature1ref_signature1/Fotoksiążka-Wzór.xmcf?o=object1&v=1&x=3&a"
        "=token1&e=1588472097&k=wrapping_key1&fl=&r=request&ckc=com.apple.clouddocs&ckz=com.apple.CloudDocs&p"
        "=31&s=s1",
        "token": "token1",
        "signature": "signature1",
        "wrapping_key": "wrapping_key1==",
        "reference_signature": "ref_signature1",
    },
    "thumbnail_token": {
        "url": "https://cvws.icloud-content.com/B/signature2ref_signature2/Scanned+document+1.jpg?o=object2&v=1&x=3&a"
        "=token2&e=1588472097&k=wrapping_key2&fl=&r=request&ckc=com.apple.clouddocs&ckz=com.apple.CloudDocs&p"
        "=31&s=s2",
        "token": "token2",
        "signature": "signature2",
        "wrapping_key": "wrapping_key2==",
        "reference_signature": "ref_signature2",
    },
    "double_etag": "32::2x",
}
DRIVE_PACKAGE_DOWNLOAD_WORKING = {
    "document_id": "111F1760-D940-480F-8C4F-005824A4E05E",
    "package_token": {
        "url": "https://cvws.icloud-content.com/B/signature1ref_signature1/Project.band?o=object1&v=1&x=3&a"
        "=token1&e=1588472097&k=wrapping_key1&fl=&r=request&ckc=com.apple.clouddocs&ckz=com.apple.CloudDocs&p"
        "=31&s=s1",
        "token": "token1",
        "signature": "signature1",
        "wrapping_key": "wrapping_key1==",
        "reference_signature": "ref_signature1",
    },
    "thumbnail_token": {
        "url": "https://cvws.icloud-content.com/B/signature2ref_signature2/Scanned+document+1.jpg?o=object2&v=1&x=3&a"
        "=token2&e=1588472097&k=wrapping_key2&fl=&r=request&ckc=com.apple.clouddocs&ckz=com.apple.CloudDocs&p"
        "=31&s=s2",
        "token": "token2",
        "signature": "signature2",
        "wrapping_key": "wrapping_key2==",
        "reference_signature": "ref_signature2",
    },
    "double_etag": "32::2x",
}
DRIVE_PACKAGE_DOWNLOAD_WORKING_EXTRACTION_ERROR = {
    "document_id": "111F1760-D940-480F-8C4F-005824A4E05F",
    "package_token": {
        "url": "https://cvws.icloud-content.com/B/signature1ref_signature1/ms.band?o=object1&v=1&x=3&a"
        "=token1&e=1588472097&k=wrapping_key1&fl=&r=request&ckc=com.apple.clouddocs&ckz=com.apple.CloudDocs&p"
        "=31&s=s1",
        "token": "token1",
        "signature": "signature1",
        "wrapping_key": "wrapping_key1==",
        "reference_signature": "ref_signature1",
    },
    "thumbnail_token": {
        "url": "https://cvws.icloud-content.com/B/signature2ref_signature2/ms.band?o=object2&v=1&x=3&a"
        "=token2&e=1588472097&k=wrapping_key2&fl=&r=request&ckc=com.apple.clouddocs&ckz=com.apple.CloudDocs&p"
        "=31&s=s2",
        "token": "token2",
        "signature": "signature2",
        "wrapping_key": "wrapping_key2==",
        "reference_signature": "ref_signature2",
    },
    "double_etag": "32::2x",
}
DRIVE_FILE_DOWNLOAD_WORKING = {
    "document_id": "516C896C-6AA5-4A30-B30E-5502C2333DAE",
    "data_token": {
        "url": "https://cvws.icloud-content.com/B/signature1ref_signature1/Scanned+document+1.pdf?o=object1&v=1&x=3&a"
        "=token1&e=1588472097&k=wrapping_key1&fl=&r=request&ckc=com.apple.clouddocs&ckz=com.apple.CloudDocs&p"
        "=31&s=s1",
        "token": "token1",
        "signature": "signature1",
        "wrapping_key": "wrapping_key1==",
        "reference_signature": "ref_signature1",
    },
    "thumbnail_token": {
        "url": "https://cvws.icloud-content.com/B/signature2ref_signature2/Scanned+document+1.jpg?o=object2&v=1&x=3&a"
        "=token2&e=1588472097&k=wrapping_key2&fl=&r=request&ckc=com.apple.clouddocs&ckz=com.apple.CloudDocs&p"
        "=31&s=s2",
        "token": "token2",
        "signature": "signature2",
        "wrapping_key": "wrapping_key2==",
        "reference_signature": "ref_signature2",
    },
    "double_etag": "32::2x",
}

# Data
ACCOUNT_FAMILY_WORKING = {
    "status-message": "Member of a family.",
    "familyInvitations": [],
    "outgoingTransferRequests": [],
    "isMemberOfFamily": True,
    "family": {
        "familyId": FAMILY_ID,
        "transferRequests": [],
        "invitations": [],
        "organizer": PERSON_ID,
        "members": [PERSON_ID, MEMBER_2_PERSON_ID, MEMBER_1_PERSON_ID],
        "outgoingTransferRequests": [],
        "etag": "12",
    },
    "familyMembers": [
        {
            "lastName": LAST_NAME,
            "dsid": PERSON_ID,
            "originalInvitationEmail": PRIMARY_EMAIL,
            "fullName": FULL_NAME,
            "ageClassification": "ADULT",
            "appleIdForPurchases": PRIMARY_EMAIL,
            "appleId": PRIMARY_EMAIL,
            "familyId": FAMILY_ID,
            "firstName": FIRST_NAME,
            "hasParentalPrivileges": True,
            "hasScreenTimeEnabled": False,
            "hasAskToBuyEnabled": False,
            "hasSharePurchasesEnabled": True,
            "shareMyLocationEnabledFamilyMembers": [],
            "hasShareMyLocationEnabled": True,
            "dsidForPurchases": PERSON_ID,
        },
        {
            "lastName": MEMBER_2_LAST_NAME,
            "dsid": MEMBER_2_PERSON_ID,
            "originalInvitationEmail": MEMBER_2_APPLE_ID,
            "fullName": MEMBER_2_FULL_NAME,
            "ageClassification": "ADULT",
            "appleIdForPurchases": MEMBER_2_APPLE_ID,
            "appleId": MEMBER_2_APPLE_ID,
            "familyId": FAMILY_ID,
            "firstName": MEMBER_2_FIRST_NAME,
            "hasParentalPrivileges": False,
            "hasScreenTimeEnabled": False,
            "hasAskToBuyEnabled": False,
            "hasSharePurchasesEnabled": False,
            "hasShareMyLocationEnabled": False,
            "dsidForPurchases": MEMBER_2_PERSON_ID,
        },
        {
            "lastName": MEMBER_1_LAST_NAME,
            "dsid": MEMBER_1_PERSON_ID,
            "originalInvitationEmail": MEMBER_1_APPLE_ID,
            "fullName": MEMBER_1_FULL_NAME,
            "ageClassification": "ADULT",
            "appleIdForPurchases": MEMBER_1_APPLE_ID,
            "appleId": MEMBER_1_APPLE_ID,
            "familyId": FAMILY_ID,
            "firstName": MEMBER_1_FIRST_NAME,
            "hasParentalPrivileges": False,
            "hasScreenTimeEnabled": False,
            "hasAskToBuyEnabled": False,
            "hasSharePurchasesEnabled": True,
            "hasShareMyLocationEnabled": True,
            "dsidForPurchases": MEMBER_1_PERSON_ID,
        },
    ],
    "status": 0,
    "showAddMemberButton": True,
}

# Fakers
PAYMENT_METHOD_ID_1 = "PAYMENT_METHOD_ID_1"
PAYMENT_METHOD_ID_2 = "PAYMENT_METHOD_ID_2"
PAYMENT_METHOD_ID_3 = "PAYMENT_METHOD_ID_3"
PAYMENT_METHOD_ID_4 = "PAYMENT_METHOD_ID_4"

# Data
ACCOUNT_DEVICES_WORKING = {
    "devices": [
        {
            "serialNumber": "●●●●●●●NG123",
            "osVersion": "OSX;10.15.3",
            "modelLargePhotoURL2x": "https://statici.icloud.com/fmipmobile/deviceImages-4.0/MacBookPro/MacBookPro15,"
            "1-spacegray/online-infobox__2x.png",
            "modelLargePhotoURL1x": "https://statici.icloud.com/fmipmobile/deviceImages-4.0/MacBookPro/MacBookPro15,"
            "1-spacegray/online-infobox.png",
            "paymentMethods": [PAYMENT_METHOD_ID_3],
            "name": "MacBook Pro de " + FIRST_NAME,
            "imei": "",
            "model": "MacBookPro15,1",
            "udid": "MacBookPro15,1" + FIRST_NAME,
            "modelSmallPhotoURL2x": "https://statici.icloud.com/fmipmobile/deviceImages-4.0/MacBookPro/MacBookPro15,"
            "1-spacegray/online-sourcelist__2x.png",
            "modelSmallPhotoURL1x": "https://statici.icloud.com/fmipmobile/deviceImages-4.0/MacBookPro/MacBookPro15,"
            "1-spacegray/online-sourcelist.png",
            "modelDisplayName": "MacBook Pro 15'",
        },
        {
            "serialNumber": "●●●●●●●UX123",
            "osVersion": "iOS;13.3",
            "modelLargePhotoURL2x": "https://statici.icloud.com/fmipmobile/deviceImages-4.0/iPhone/iPhone12,"
            "1-1-6-0/online-infobox__2x.png",
            "modelLargePhotoURL1x": "https://statici.icloud.com/fmipmobile/deviceImages-4.0/iPhone/iPhone12,"
            "1-1-6-0/online-infobox.png",
            "paymentMethods": [
                PAYMENT_METHOD_ID_4,
                PAYMENT_METHOD_ID_2,
                PAYMENT_METHOD_ID_1,
            ],
            "name": "iPhone de " + FIRST_NAME,
            "imei": "●●●●●●●●●●12345",
            "model": "iPhone12,1",
            "udid": "iPhone12,1" + FIRST_NAME,
            "modelSmallPhotoURL2x": "https://statici.icloud.com/fmipmobile/deviceImages-4.0/iPhone/iPhone12,"
            "1-1-6-0/online-sourcelist__2x.png",
            "modelSmallPhotoURL1x": "https://statici.icloud.com/fmipmobile/deviceImages-4.0/iPhone/iPhone12,"
            "1-1-6-0/online-sourcelist.png",
            "modelDisplayName": "iPhone 11",
        },
    ],
    "paymentMethods": [
        {
            "lastFourDigits": "333",
            "balanceStatus": "NOTAPPLICABLE",
            "suspensionReason": "ACTIVE",
            "id": PAYMENT_METHOD_ID_3,
            "type": "Boursorama Banque",
        },
        {
            "lastFourDigits": "444",
            "balanceStatus": "NOTAPPLICABLE",
            "suspensionReason": "ACTIVE",
            "id": PAYMENT_METHOD_ID_4,
            "type": "Carte Crédit Agricole",
        },
        {
            "lastFourDigits": "2222",
            "balanceStatus": "NOTAPPLICABLE",
            "suspensionReason": "ACTIVE",
            "id": PAYMENT_METHOD_ID_2,
            "type": "Lydia",
        },
        {
            "lastFourDigits": "111",
            "balanceStatus": "NOTAPPLICABLE",
            "suspensionReason": "ACTIVE",
            "id": PAYMENT_METHOD_ID_1,
            "type": "Boursorama Banque",
        },
    ],
}

ACCOUNT_STORAGE_WORKING = {
    "storageUsageByMedia": [
        {
            "mediaKey": "photos",
            "displayLabel": "Photos et vidéos",
            "displayColor": "ffcc00",
            "usageInBytes": 0,
        },
        {
            "mediaKey": "backup",
            "displayLabel": "Sauvegarde",
            "displayColor": "5856d6",
            "usageInBytes": 799008186,
        },
        {
            "mediaKey": "docs",
            "displayLabel": "Documents",
            "displayColor": "ff9500",
            "usageInBytes": 449092146,
        },
        {
            "mediaKey": "mail",
            "displayLabel": "Mail",
            "displayColor": "007aff",
            "usageInBytes": 1101522944,
        },
    ],
    "storageUsageInfo": {
        "compStorageInBytes": 0,
        "usedStorageInBytes": 2348632876,
        "totalStorageInBytes": 5368709120,
        "commerceStorageInBytes": 0,
    },
    "quotaStatus": {
        "overQuota": False,
        "haveMaxQuotaTier": False,
        "almost-full": False,
        "paidQuota": False,
    },
}

# Photos
PHOTOS_RECORD_TYPE_CHECK_INDEXING_STATE = {
    "records": [],
    "syncToken": "AQAAAAAAArKjf//////////fSxWSKv5JfZASQT7N0a1m",
}

PHOTOS_GET_CURRENT_SYNC_TOKEN_WORKING = {
    "records": [
        {
            "recordName": "_f1f01b2b-0756-40a3-a5eb-d084d0b9646d",
            "recordType": "CheckIndexingState",
            "fields": {
                "progress": {"value": 100, "type": "INT64"},
                "state": {"value": "FINISHED", "type": "STRING"},
            },
            "pluginFields": {},
            "recordChangeTag": "0",
            "created": {
                "timestamp": 1629751434682,
                "userRecordName": "_10",
                "deviceID": "1",
            },
            "modified": {
                "timestamp": 1629751434682,
                "userRecordName": "_10",
                "deviceID": "1",
            },
            "deleted": False,
            "zoneID": {
                "zoneName": "PrimarySync",
                "ownerRecordName": "_fvhhqlzef1uvsgxnrw119mylkpjut1a0",
                "zoneType": "REGULAR_CUSTOM_ZONE",
            },
        },
    ],
    "syncToken": "AQAAAAAAArKjf//////////fSxWSKv5JfZASQT7N0a1m",
}


class ResponseMock(Response):
    """Mocked Response."""

    def __init__(self, result, status_code=200, **kwargs):
        """Init the object."""
        Response.__init__(self)
        self.result = result
        self.status_code = status_code
        self.raw = kwargs.get("raw")
        self.url = kwargs.get("url")
        self.headers = kwargs.get("headers", {})

    @property
    def text(self):
        """Return json as string."""
        return json.dumps(self.result)


class ICloudPySessionMock(base.ICloudPySession):
    """Mocked ICloudPySession."""

    def request(self, method, url, **kwargs):
        """Override request method."""
        params = kwargs.get("params")
        headers = kwargs.get("headers")
        data = json.loads(kwargs.get("data", "{}"))

        # Login
        if self.service.setup_endpoint in url:
            if "accountLogin" in url and method == "POST":
                if data.get("dsWebAuthToken") not in VALID_TOKENS:
                    self._raise_error(None, "Unknown reason")
                if data.get("dsWebAuthToken") == REQUIRES_2FA_TOKEN:
                    return ResponseMock(LOGIN_2FA)
                return ResponseMock(LOGIN_WORKING)

            if "listDevices" in url and method == "GET":
                return ResponseMock(TRUSTED_DEVICES)

            if "sendVerificationCode" in url and method == "POST":
                if data == TRUSTED_DEVICE_1:
                    return ResponseMock(VERIFICATION_CODE_OK)
                return ResponseMock(VERIFICATION_CODE_KO)

            if "validateVerificationCode" in url and method == "POST":
                TRUSTED_DEVICE_1.update({"verificationCode": "0", "trustBrowser": True})
                if data == TRUSTED_DEVICE_1:
                    self.service.user["apple_id"] = AUTHENTICATED_USER
                    return ResponseMock(VERIFICATION_CODE_OK)
                self._raise_error(None, "FOUND_CODE")

            if "validate" in url and method == "POST":
                if headers.get("X-APPLE-WEBAUTH-TOKEN") == VALID_COOKIE:
                    return ResponseMock(LOGIN_WORKING)
                self._raise_error(None, "Session expired")

        if self.service.auth_endpoint in url:
            if "signin" in url and method == "POST":
                if data.get("accountName") not in VALID_USERS:
                    self._raise_error(None, "Unknown reason")
                if url.endswith("/init"):
                    return ResponseMock(SRP_INIT_OK)
                if data.get("accountName") == REQUIRES_2FA_USER:
                    self.service.session_data["session_token"] = REQUIRES_2FA_TOKEN
                    return ResponseMock(AUTH_OK)

                self.service.session_data["session_token"] = VALID_TOKEN
                return ResponseMock(AUTH_OK)

            if "securitycode" in url and method == "POST":
                if data.get("securityCode", {}).get("code") != VALID_2FA_CODE:
                    self._raise_error(None, "Incorrect code")

                self.service.session_data["session_token"] = VALID_TOKEN
                return ResponseMock("", status_code=204)

            if "trust" in url and method == "GET":
                return ResponseMock("", status_code=204)

        # Account
        if "device/getDevices" in url and method == "GET":
            return ResponseMock(ACCOUNT_DEVICES_WORKING)
        if "family/getFamilyDetails" in url and method == "GET":
            return ResponseMock(ACCOUNT_FAMILY_WORKING)
        if "setup/ws/1/storageUsageInfo" in url and method == "GET":
            return ResponseMock(ACCOUNT_STORAGE_WORKING)

        # Drive
        if "retrieveItemDetailsInFolders" in url and method == "POST" and data[0].get("drivewsid"):
            if data[0].get("drivewsid") == "FOLDER::com.apple.CloudDocs::root":
                return ResponseMock(DRIVE_ROOT_WORKING)
            if data[0].get("drivewsid") == "FOLDER::com.apple.CloudDocs::documents":
                return ResponseMock(DRIVE_ROOT_INVALID)
            if (
                data[0].get("drivewsid") == "FOLDER::com.apple.CloudDocs::1C7F1760-D940-480F-8C4F-005824A4E05B"
                or data[0].get("drivewsid") == "FOLDER::com.apple.CloudDocs::1C7F1760-D940-480F-8C4F-005824A4E05D"
            ):
                return ResponseMock(DRIVE_FOLDER_WORKING)
            if data[0].get("drivewsid") == "FOLDER::com.apple.CloudDocs::D5AA0425-E84F-4501-AF5D-60F1D92648CF":
                return ResponseMock(DRIVE_SUBFOLDER_WORKING)
            if data[0].get("drivewsid") == "FOLDER::com.apple.CloudDocs::1C7F1760-D940-480F-8C4F-005824A4E05C":
                return ResponseMock(DRIVE_SUBFOLDER_UNWANTED_WORKING)
        # Drive download
        if "com.apple.CloudDocs/download/by_id" in url and method == "GET":
            if params.get("document_id") in [
                "516C896C-6AA5-4A30-B30E-5502C2333DAE",
                "33A41112-4131-4938-9691-7F356CE3C51D",
                "111F1760-D940-480F-8C4F-005824A4E05D",
            ]:
                return ResponseMock(DRIVE_FILE_DOWNLOAD_WORKING)
            if params.get("document_id") in [
                "111F1760-D940-480F-8C4F-005824A4E05E",
            ]:
                return ResponseMock(DRIVE_PACKAGE_DOWNLOAD_WORKING)
            if params.get("document_id") in [
                "111F1760-D940-480F-8C4F-005824A4E05F",
            ]:
                return ResponseMock(DRIVE_PACKAGE_DOWNLOAD_WORKING_EXTRACTION_ERROR)
            if params.get("document_id") in ["111F1760-D940-480F-8C4F-005824A4E05G"]:
                return ResponseMock(DRIVE_PACKAGE_SPECIAL_CHARS_WORKING)
        if "icloud-content.com" in url and method == "GET":
            if "Scanned+document+1.pdf" in url or "Document scanne 2.pdf" in url:
                return ResponseMock(
                    {},
                    raw=open(
                        os.path.join(
                            os.path.dirname(__file__),
                            "ms.band",
                            "Alternatives",
                            "000",
                            "WindowImage.jpg",
                        ),
                        "rb",
                    ),
                )
            if "This is a title.md" in url:
                return ResponseMock({}, raw=open("This is a title.md", "rb"))
            if "Fotoksiążka-Wzór.xmcf" in url:
                return ResponseMock(
                    {},
                    url="/packageDownload?",
                    raw=open(
                        os.path.join(os.path.dirname(__file__), "Fotoksiążka-Wzór.xmcf.zip"),
                        "rb",
                    ),
                )
            if "Project.band" in url:
                return ResponseMock(
                    {},
                    url="/packageDownload?",
                    raw=open(
                        os.path.join(os.path.dirname(__file__), "Project.band.zip"),
                        "rb",
                    ),
                )
            if "ms.band" in url:
                return ResponseMock(
                    {},
                    url="/packageDownload?",
                    raw=open(
                        os.path.join(os.path.dirname(__file__), "ms.band.zip"),
                        "rb",
                    ),
                )
        # Find My iPhone
        if "fmi" in url and method == "POST":
            return ResponseMock(FMI_FAMILY_WORKING)

        # Photos
        if "com.apple.photos.cloud" in url:
            if url.endswith("zones/list"):
                return ResponseMock(ZONES_LIST_WORKING)
            if url.endswith("remapEnums=True&getCurrentSyncToken=True"):
                if data.get("query").get("recordType") == "CheckIndexingState":
                    return ResponseMock(
                        photos_data.DATA["query?remapEnums=True&getCurrentSyncToken=True"][0]["response"],
                    )
                if data.get("query").get("recordType") == "CPLAssetAndMasterHiddenByAssetDate":
                    return ResponseMock(
                        photos_data.DATA["query?remapEnums=True&getCurrentSyncToken=True"][5]["response"],
                    )
                if data.get("query").get("recordType") == "CPLAssetAndMasterDeletedByExpungedDate":
                    return ResponseMock(
                        photos_data.DATA["query?remapEnums=True&getCurrentSyncToken=True"][5]["response"],
                    )
                if data.get("query").get("recordType") == "CPLBurstStackAssetAndMasterByAssetDate":
                    return ResponseMock(
                        photos_data.DATA["query?remapEnums=True&getCurrentSyncToken=True"][5]["response"],
                    )

                if data.get("query").get("recordType") in ("CPLAssetAndMasterInSmartAlbumByAssetDate"):
                    if "filterBy" in data["query"] and data.get("query").get("filterBy")[2]["fieldValue"]["value"] in (
                        "TIMELAPSE",
                        "LIVE",
                        "VIDEO",
                        "SLOMO",
                        "FAVORITE",
                        "SCREENSHOT",
                        "BURST",
                        "PANORAMA",
                    ):
                        return ResponseMock(
                            photos_data.DATA["query?remapEnums=True&getCurrentSyncToken=True"][5]["response"],
                        )
                    if (
                        "filterBy" in data["query"]
                        and data.get("query").get("filterBy")[2]["fieldValue"]["value"] == "VIDEO"
                    ):
                        return ResponseMock(
                            photos_data.DATA["query?remapEnums=True&getCurrentSyncToken=True"][5]["response"],
                        )
                if data.get("query").get("recordType") == "CPLAlbumByPositionLive":
                    if (
                        "filterBy" in data["query"]
                        and data.get("query").get("filterBy")[0]["fieldValue"]["value"]
                        == "E4RT4FB7-4A35-4958-1D42-5769E66BE407"
                    ):
                        return ResponseMock(
                            photos_data.DATA["query?remapEnums=True&getCurrentSyncToken=True"][4]["response"],
                        )

                    if (
                        "filterBy" in data["query"]
                        and data.get("query").get("filterBy")[0]["fieldValue"]["value"]
                        == "CB3DB78F-D683-42D5-A340-A5DECC7397F6"
                    ):
                        return ResponseMock(
                            photos_data.DATA["query?remapEnums=True&getCurrentSyncToken=True"][5]["response"],
                        )
                    if (
                        "filterBy" in data["query"]
                        and data.get("query").get("filterBy")[0]["fieldValue"]["value"]
                        == "E803E065-D8A4-4398-DE23-23F8FD0886EB"
                    ):
                        return ResponseMock(
                            photos_data.DATA["query?remapEnums=True&getCurrentSyncToken=True"][6]["response"],
                        )
                    if (
                        "filterBy" in data["query"]
                        and data.get("query").get("filterBy")[0]["fieldValue"]["value"]
                        == "E803E065-D8A4-4398-DE23-23F8FD0886EC"
                    ):
                        return ResponseMock(
                            photos_data.DATA["query?remapEnums=True&getCurrentSyncToken=True"][7]["response"],
                        )
                    if (
                        "zoneID" in data
                        and data.get("zoneID").get("zoneName") == "SharedSync-9DD9B767-9F30-4D6F-B658-F17DBA16D107"
                    ):
                        return ResponseMock(
                            photos_data.DATA["query?remapEnums=True&getCurrentSyncToken=True"][8]["response"],
                        )

                    return ResponseMock(
                        photos_data.DATA["query?remapEnums=True&getCurrentSyncToken=True"][1]["response"],
                    )
                if data.get("query").get("recordType") == "CPLAssetAndMasterByAddedDate":
                    if data.get("query").get("filterBy")[0]["fieldValue"]["value"] == 0:
                        return ResponseMock(
                            photos_data.DATA["query?remapEnums=True&getCurrentSyncToken=True"][9]["response"],
                        )
                    return ResponseMock(
                        photos_data.DATA["query?remapEnums=True&getCurrentSyncToken=True"][8]["response"],
                    )
                if data.get("query").get("recordType") == "CPLContainerRelationLiveByAssetDate":
                    if data.get("query").get("filterBy")[0]["fieldValue"]["value"] == 0:
                        return ResponseMock(
                            photos_data.DATA["query?remapEnums=True&getCurrentSyncToken=True"][2]["response"],
                        )
                    if data.get("query").get("filterBy")[0]["fieldValue"]["value"] == 7:
                        return ResponseMock(
                            photos_data.DATA["query?remapEnums=True&getCurrentSyncToken=True"][3]["response"],
                        )
            if "query/batch?remapEnums=True&getCurrentSyncToken=True" in url:
                return ResponseMock(
                    photos_data.DATA["query/batch?remapEnums=True&getCurrentSyncToken=True"][0]["response"],
                )
        # Photos download
        if (
            # IMG_3327.JPG
            "https://cvws.icloud-content.com/B/ARKzBUr-DdmTaP_SAVglTurWtsmrAb5Vyk36t2jwuON7WSxvon_DvGtK" in url
            # IMG_3322.JPG
            or "https://cvws.icloud-content.com/B/ASTSuc7S58IPmVCJIUslbeCRjsnoASIoOBi88potAS0gE8tfnojuSlrb" in url
            # IMG_3306.JPG
            or "https://cvws.icloud-content.com/B/ATTRy6p-Q3U1HqcF6BUKrrOMnjvnATqG89bMsXhtmMRMw009uhyJc_Kh" in url
            # IMG_3148.JPG
            or "https://cvws.icloud-content.com/B/ARZd_GzpY62XRtXt+jP6UsV4fBZHATi6BbOzDuHl6RONNFCub9eqZqSm" in url
            # no-extension
            or "https://cvws.icloud-content.com/B/ARZd_GzpY62XRtXt+jP6UsV4fBZIATi6BbOzDuHl6RONNFCub9eqZqSn" in url
            # IMG_3328.JPG
            or "https://cvws.icloud-content.com/B/EeGlt2PppPTgd0Q7mp8GenIugSh7AQYmx-DRYXnMs0tkDZ3rorp4IB99" in url
            # IMG_3148.JPG another device
            or "https://cvws.icloud-content.com/B/ATTRy6p-Q3U1HqcF6BUKrrOMnjvoATqG89bMsXhtmMRMw009uhyJc_Kh" in url
            # IMG_5513.HEIC Shared Library
            or "https://cvws.icloud-content.com/B/AQDN6auXvelQyb_btBqkNNjA97E2AZ_h3_ZBuSDV7J1SfMKpllmP-FGN" in url
        ):
            return ResponseMock(
                {},
                raw=open(os.path.join(os.path.dirname(__file__), "medium.jpeg"), "rb"),
            )
        if (
            # IMG_3327.JPG
            "https://cvws.icloud-content.com/B/AUvKU8j-Z5pfqGI_fe-9tibuqfVRAd0I2qxdsqlGuSLlqtTBgoKndHE_" in url
            # IMG_3322.JPG
            or "https://cvws.icloud-content.com/B/AUxVFT2yVsQ5739tmU5c1497duFDAdkoZP1534bwlULpwCdn2fd44LAt" in url
            # IMG_3306.JPG
            or "https://cvws.icloud-content.com/B/Ab_8kUAhnGzSxnl9yWvh8JKBpOvVAVLSGMHt-PAQ9_krqqfXATNX57d5" in url
            # IMG_3148.JPG
            or "https://cvws.icloud-content.com/B/AVx3_VKkbWPdNbWw68mrWzSuemXgAdUIDFzHC2rVOvwTz0jPi_tKihnb" in url
            # no-extension
            or "https://cvws.icloud-content.com/B/AVx3_VKkbWPdNbWw68mrWzSuemXiAdUIDFzHC2rVOvwTz0jPi_tKihnn" in url
            # IMG_3328.JPG
            or "https://cvws.icloud-content.com/B/YN1v8eGiHYYZ_aKUkMuGtSf0P1BNAXKVYPcDa-9Mjvnap0ZS-p2Z24V3" in url
            # IMG_3148.JPG another device
            or "https://cvws.icloud-content.com/B/Ab_8kUAhnGzSxnl9yWvh8JKBpOvWAVLSGMHt-PAQ9_krqqfXATNX57d5" in url
            # IMG_5513.HEIC Shared Library
            or "https://cvws.icloud-content.com/B/AY4eS1ezj9pmMHzfVzwC2CLmBwZOAXKLBx985QzfCKCGyN0wbGs6SuTf" in url
        ):
            return ResponseMock(
                {},
                raw=open(os.path.join(os.path.dirname(__file__), "original.jpeg"), "rb"),
            )
        if (
            # IMG_3327.JPG
            "https://cvws.icloud-content.com/B/ASy6f_leU1-xkR1aPmQyvYmwHUpEARHOzkI3sbX3SZDmNQgttNJ9DqQa" in url
            # IMG_3322.JPG
            or "https://cvws.icloud-content.com/B/ASPVZ_Pft6gIN2VEA_oUbqQzh6WyAXd258pYF6LLhmADLoZAumNqI-8M" in url
            # IMG_3306.JPG
            or "https://cvws.icloud-content.com/B/AQNND5zpteAXnnBP2BmDd0ropjY9AV2Zh7WygJu74eNWVuuMT4lM8qme" in url
            # IMG_3148.JPG
            or "https://cvws.icloud-content.com/B/ARpHiouI3Ib_ziuZYTCiSikohvMYARtMrcvA8cbMefPDnmwSWQwe-mBd" in url
            # no-extension
            or "https://cvws.icloud-content.com/B/ARpHiouI3Ib_ziuZYTCiSikohvMZARtMrcvA8cbMefPDnmwSWQwe-mBe" in url
            # IMG_3328.JPG
            or "https://cvws.icloud-content.com/B/DmK0xzSiAUSFrAsYYAvby7QHrMDeAR5TiM9Qko4rHwmoDH1BgNRVZpF4" in url
            # IMG_3148.JPG another device
            or "https://cvws.icloud-content.com/B/AQNND5zpteAXnnBP2BmDd0ropjY0AV2Zh7WygJu74eNWVuuMT4lM8qme" in url
            # IMG_5513.HEIC Shared Library
            or "https://cvws.icloud-content.com/B/Aa_QVPVEM9bvm5Owy3GRFNyqbKuXAbgec55EhUFp9db5znXM3Xz-nq1X" in url
        ):
            return ResponseMock(
                {},
                raw=open(os.path.join(os.path.dirname(__file__), "thumb.jpeg"), "rb"),
            )
        return None


class ICloudPyServiceMock(base.ICloudPyService):
    """Mocked ICloudPyService."""

    def __init__(
        self,
        apple_id,
        password=None,
        cookie_directory=None,
        verify=True,
        client_id=None,
        with_family=True,
        auth_endpoint="https://idmsa.apple.com/appleauth/auth",
        # For China, use "https://www.icloud.com.cn"
        home_endpoint="https://www.icloud.com",
        # For China, use "https://setup.icloud.com.cn/setup/ws/1"
        setup_endpoint="https://setup.icloud.com/setup/ws/1",
    ):
        """Init with defaults for optionals."""
        base.ICloudPySession = ICloudPySessionMock
        base.ICloudPyService.__init__(
            self,
            apple_id,
            password,
            cookie_directory,
            verify,
            client_id,
            with_family,
            auth_endpoint,
            home_endpoint,
            setup_endpoint,
        )
